Re: [R] Installing RGDAL on CentOS v.6.2
Dear Eric, Thank you for your reply. Unfortunately, I don't have NetBSD on the cluster and considering the size of my dataset, I can't utilise my local machine. Does it make a difference that the R installed on the cluster is up-to-date if I do want to compile everything from tar.gz? Thanks again. Sincerely, Shouro On Sun, Aug 9, 2015 at 4:31 AM, Eric Brown br...@fastmail.com wrote: Dear Shouro, I can confirm that I have installed GDAL (and RGDAL) on CentOS 6.4, 6.5, and 6.6. But quite frankly, these systems have such old versions of software that I spent a fair amount of time compiling everything up from tar.gz. This is exhausting, so I spent some time learning NetBSD's pkgsrc--and now recommend this wonderful package manager to anyone caught in a situation where they don't have root privileges, but need to bring an old CentOS to have modern versions of software and all its dependencies. Best regards, Eric Shouro Dasgupta sho...@gmail.com writes: Dear all, I have access to an IBM IDataplex Cluster with CentOS v.6.2. R 3.2.1 is currently installed. I was wondering if there was any way to install RGDAL on it? Thanks! Sincerely, Shouro [[alternative HTML version deleted]] -- *Shouro Dasgupta* PhD Candidate Science and Management of Climate Change Department of Economics | Ca' Foscari University of Venice --- Junior Researcher Fondazione Eni Enrico Mattei (FEEM) | Centro Euro-Mediterraneo per i Cambiamenti Climatici (CMCC) Isola di San Giorgio Maggiore, 8 30124 Venezia Phone: +39 041 2700 436 [[alternative HTML version deleted]] __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] Recursive looping of a list in R
Hi Evans, not many people (incl. me) are going to guess the building law for your recursive structure from the -- in fact at first sight not so clear -- picture, but I have some comments inline below. Hth -- Gerrit I am trying to creat a list from a loop such that once you loop the value obtained is appended onto the list, then you loop through that value to give the next elemet of the list and the system continues recusively. To be clear I am creating a list to contain elements of the following tree probabilities; http://r.789695.n4.nabble.com/file/n4710898/help.png . The elements of the diagram should be presented in a list such that each level of the tree represents elements in the list (only the coefficients are of interest). I have this code to start with If you use a while-loop without a termination criterion and, e.g., a call to break, in its body it would run forever (if the code in its body were correct). Start coding with a (finite) for-loop. (Or even better start setting j and i by hand and let your code be evaluated step by step.) j - 0 while(j = 0){ j - j+1 Here you create in each loop the same starting list (which I guess is not what you want/should): occlist - list(1) So, as a consequence an error occurs for j = 2 in the following for-loop, because occlist has always only 1 component: for(i in occlist[[j]]){ occ_cell - seq(i, i+1, by = 1) The following two lines of code compensate each other, so seem to be superfluous: occllist - list(occ_cell) occunlist - as.vector(unlist(occllist, recursive = TRUE)) occlist[[j]] - occunlist print(occlist) } } Any assistance will be highly appreciated. Thanks. -- View this message in context: http://r.789695.n4.nabble.com/Recursive-looping-of-a-list-in-R-tp4710898.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R-es] Duda ' proj4string'
Hola, mi trozo de c�digo es: # Primero creamos el mapa de toda la instrumentaci�n rm(list=ls()) # remove all the variables from the workspace setwd(C:/Users/Marcos/Documents/TFM/Situacion_pluviometros/) library(ggmap) library(rgdal) library(ggplot2) library(scales) library(maptools) # Convertimos coordenadas de UTM a geogr�ficas: # Leemos el archivo de texto donde est�n las coordenadas UTM de los Pluvi�metros coord - read.delim(C:/Users/Marcos/Documents/TFM/Situacion_pluviometros/pluviometrosVenero.txt, header=TRUE)[,4:5] # A�adimos coordenadas del TDR, los dos limn�metros y el radar meteorol�gico (figura 3.1 TFM_Carlos) coord.todo - rbind(coord,c(356489,4474915), c(360744,4470212), c(360040,4471782), c(359088,4474084)) rownames(coord.todo)=make.names(c(rep(Pluvi�metros,7), Radar, TDR, rep(Limn�metros,2)), unique=TRUE) coord.todo.spdf - coord.todo # .spdf: Class for spatial attributes that have spatial point locations colnames(coord.todo.spdf) - c(x,y) coordinates(coord.todo.spdf) - ~x+y # To retrieve the CRS for a spatial object: proj4string(x) proj4string(coord.todo.spdf) - CRS(+proj=utm +zone=30 ellps=WGS84) # Ahora pasamos de un CRS a otro (pasamos de coordenadas UTM a geogr�ficas) coord.geog - as.data.frame(spTransform(coord.todo.spdf, CRS(+proj=longlat +datum=WGS84))) colnames(coord.geog) - c(lon, lat) # Creamos un data.frame llamado datos para poder pintar bien la leyenda del mapa datos - coord.todo datos$lon - coord.geog$lon datos$lat - coord.geog$lat datos$INSTRUMENTACI�N - c(Pluvi�metro,Pluvi�metro,Pluvi�metro,Pluvi�metro,Pluvi�metro,Pluvi�metro,Pluvi�metro, Radar meteorol�gico,TDR,Limn�metro,Limn�metro) # Ahora con la funci�n get_map consultamos en Google Maps el mapa # que queremos crear de nuestra zona de estudio mapa - get_map(location=c(lon=-4.66, lat=40.39), zoom=13, maptype=terrain, source=google) nombres.pluvio - c(Arromoro, Atalaya, Dehesa, Gasolinera, Collado Morales, Pe�a Parda, Trampalones) # Cercamos el �rea de la cuenca area - readShapePoly(venero_Project.shp) # Lee el shape con el area de la cuenca proj4string(area) # Describes data's current coordinate reference system # To change to correct projection: area - spTransform(area, CRS(+proj=longlat +datum=WGS84)) proj4string(area) - +proj=utm +zone=30 +north +ellps=WGS84 +datum=WGS84 +units=m +no_defs png(mapa_zona_estudio.png, units=in, width=9, height=8.5, res=300) # Vamos a pintar los distintos instrumentos de medida sobre el mapa (junto con �ste) y a�adimos leyenda ggmap(mapa, extend='device', legend=left, base_layer=ggplot(datos, aes(x=lon, y=lat))) + geom_point(data=datos, aes(shape = INSTRUMENTACI�N, color=INSTRUMENTACI�N, fill=INSTRUMENTACI�N), size=7.5) + geom_text(data=coord.geog[1:7,], aes(x=coord.geog$lon[1:7], y=coord.geog$lat[1:7], label=nombres.pluvio, hjust=0.2, vjust=1), size=5.2) + scale_shape_manual(values=c(21,24,22,23)) geom_polygon(aes(x=long, y=lat, group=id), data=area, color=white, alpha=.4, size=.2) dev.off() El error que me da la consola de R es: Error in spTransform(xSP, CRSobj, ...) : No transformation possible from NA reference system �Alguien me puede decir lo que hay que hacer para que ya no me de este error? Muchas gracias de antemano. Un saludo, Marcos [[alternative HTML version deleted]] ___ R-help-es mailing list R-help-es@r-project.org https://stat.ethz.ch/mailman/listinfo/r-help-es
Re: [R] Automatically updating a WordPress blog from R
I dont know whether this will help you because even I am also pretty new to R but have some experience in web development. I would recommend you to read about cron jobs . cron jobs automate your request and execute according to your execution parameters (1 minute, 3.5 days etc) -- View this message in context: http://r.789695.n4.nabble.com/Automatically-updating-a-WordPress-blog-from-R-tp4710914p4710919.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] inbuilt crossover function for backtesting
I am trying to built a simple moving average cross over strategy for backtesting. I have installed TTR and quantmod, quantstrat for that purpose. From TTR package we can get functions for sma,bolinger band and other indicators. I want to know whether any inbuilt crossover function (not greater '' or lesser '') is available for R. Example sma10-SMA(close,10) sma30-SMA(close,30) buy-Crossover(sma10,sma30) sell-Crossover(sma30,sma10) -- View this message in context: http://r.789695.n4.nabble.com/inbuilt-crossover-function-for-backtesting-tp4710918.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] Installing RGDAL on CentOS v.6.2
Dear Shouro, I should have mentioned that pkgsrc is cross-platform, and not restricted to the NetBSD OS. I use pkgsrc on my CentOS machines to provide up-to-date software. Since sysadmins tend to be conservative about what they will install on computers, I end up installing my own software into my own personal directory. I don't think that the version of R is indicative of whether proj4 and gdal will compile. IIRC, I had to install a number of dependencies to be able to build these from source. It might be worthwhile to see if your sysadmin will install gdal and proj4 from the CentOS distro. These will probably be quite old -- though they may be enough for your needs. Alternatively, there are some third-party repositories for up-to-date software for CentOS, including EPEL and ELGIS, the latter especially targeted toward geospatial modeling. Best regards, Eric Shouro Dasgupta sho...@gmail.com writes: Dear Eric, Thank you for your reply. Unfortunately, I don't have NetBSD on the cluster and considering the size of my dataset, I can't utilise my local machine. Does it make a difference that the R installed on the cluster is up-to-date if I do want to compile everything from tar.gz? Thanks again. Sincerely, Shouro __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] result NA , but expected True or False
Dear Group, Kindly, I have those two lines if( (z_nebla==0) || (z_nebla_dash==0) ) CM - 0 else CM - 0.5 *(1/a) + 0.5*(1/b) when running it I got this z_nebla==0) logical(0) (z_nebla_dash==0) logical(0) (z_nebla==0) || (z_nebla_dash==0) [1] NA why (z_nebla==0) || (z_nebla_dash==0) gives me NA ? thanks in advance Ragia [[alternative HTML version deleted]] __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] Parsing all rows columns of a Dataframe into one column
Hi All, I am using R for reading certain values in a dataset. I have values in a data frame all scattered in different columns rows, some values might be NA as well. e.g. below three columns V1, V2,V3, and their respective values. V1 V2 V2 NA NA 90 abc 89.09 $50 76799 NA NA 02:15 def 1 What I would like to do is parse this data frame, create a new data frame, omit all NA values. The new data frame would have one column, lets say Value column. (order of the samples coming is not an issue) New Data Frame (Output Required): Value abc 76799 02:15 89.09 def 90 $50 1 Any help would be appreciated. Regards, Anshuk Pal Chaudhuri [[alternative HTML version deleted]] __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] inbuilt crossover function for backtesting
On Sun, Aug 9, 2015 at 3:46 AM, boredstoog via R-help r-help@r-project.org wrote: I am trying to built a simple moving average cross over strategy for backtesting. I have installed TTR and quantmod, quantstrat for that purpose. From TTR package we can get functions for sma,bolinger band and other indicators. I want to know whether any inbuilt crossover function (not greater '' or lesser '') is available for R. help.search(crossover) would have lead you to quantstrat::sigCrossover. require(quantstrat) getSymbols(SPY) SPY$sma10 - SMA(Cl(SPY),10) SPY$sma30 - SMA(Cl(SPY),30) buy - sigCrossover(buy, SPY, c(sma10,sma30), gt) sell - sigCrossover(sell, SPY, c(sma30,sma10), lt) Example sma10-SMA(close,10) sma30-SMA(close,30) buy-Crossover(sma10,sma30) sell-Crossover(sma30,sma10) -- View this message in context: http://r.789695.n4.nabble.com/inbuilt-crossover-function-for-backtesting-tp4710918.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. -- Joshua Ulrich | about.me/joshuaulrich FOSS Trading | www.fosstrading.com __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] Data frame Q
Dear Group, Kindly, I have the following Common_Friends - intersect(node_neighbours_i_out,node_neighbours_j_out) class(Common_Friends) print(Common_Friends) #4 = Common_Friends newline-c(i, Common_Friends ) df- rbind(df,newline) I created a data frame to add the new line when Common_Friends =0 nothing add ?, how to force it to write the value into the data frame Common_Friends - intersect(node_neighbours_i_out,node_neighbours_j_out) class(Common_Friends) [1] numeric print(Common_Friends) numeric(0) newline-c(i, Common_Friends ) newline [1] 5 thanks in advance Ragia [[alternative HTML version deleted]] __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] Installing RGDAL on CentOS v.6.2
Dear Shouro, I can confirm that I have installed GDAL (and RGDAL) on CentOS 6.4, 6.5, and 6.6. But quite frankly, these systems have such old versions of software that I spent a fair amount of time compiling everything up from tar.gz. This is exhausting, so I spent some time learning NetBSD's pkgsrc--and now recommend this wonderful package manager to anyone caught in a situation where they don't have root privileges, but need to bring an old CentOS to have modern versions of software and all its dependencies. Best regards, Eric Shouro Dasgupta sho...@gmail.com writes: Dear all, I have access to an IBM IDataplex Cluster with CentOS v.6.2. R 3.2.1 is currently installed. I was wondering if there was any way to install RGDAL on it? Thanks! Sincerely, Shouro [[alternative HTML version deleted]] __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.