Re: [R-sig-Geo] R: R: suggestion to write a more elegant code

2008-10-16 Thread James Nylen
On Thu, Oct 16, 2008 at 8:23 PM, Alessandro <[EMAIL PROTECTED]>wrote: > It's Run > > > power<- seq(1.5, 4.0, by=0.1) > for (i in 1:length(power)){ > rsaga.grid.calculus(in.grids = c("DCM_1.sgrd"), > out.grid = paste("DCM_1_power",i,".sgrd",sep=""), > formula = paste("a^",po

[R-sig-Geo] R: R: suggestion to write a more elegant code

2008-10-16 Thread Alessandro
It's Run power<- seq(1.5, 4.0, by=0.1) for (i in 1:length(power)){ rsaga.grid.calculus(in.grids = c("DCM_1.sgrd"), out.grid = paste("DCM_1_power",i,".sgrd",sep=""), formula = paste("a^",power[i],sep="")) } BUT... the only fix is create files with name DCM_1_po

Re: [R-sig-Geo] R: suggestion to write a more elegant code

2008-10-16 Thread Alexander Brenning
how about this... power<- seq(1.5, 4.0, by=0.1) for (i in 1:length(power)){ rsaga.grid.calculus(in.grids = c("DCM_1.sgrd"), out.grid = paste("DCM_1_power",i,".sgrd",sep=""), formula = paste("a^",power[i],sep="")) } Alessandro wrote: Hi Thanx Alex and Mike SORRY I am

[R-sig-Geo] R: suggestion to write a more elegant code

2008-10-16 Thread Alessandro
Hi Thanx Alex and Mike SORRY I am a brand-new I tried this formula for (pow in seq(1.5, 4.0, by = 0.1)) rsaga.grid.calculus(in.grids = c("DCM_1.sgrd"), out.grid = "DCM_1_power15.sgrd", formula = paste("a^", pow, sep="")) but the code create only one raster (DCM_1_power

Re: [R-sig-Geo] suggestion to write a more elegant code

2008-10-16 Thread Alexander Brenning
Hi, first, your formulas should read ~a^1.4 etc.; 'a' represents the first (and in your case only) grid in in.grids. Instead of using a formula, you can use a character string: formula = "a^1.5" etc., so you just have to 'paste' things together; this should work: for (pow in seq(1.5, 4.0, b

[R-sig-Geo] suggestion to write a more elegant code

2008-10-16 Thread Alessandro
Hi all, I need a suggestion to write this code in R more elegant . I have a DSM grid and I need to create a different grid raisin to different power. Thanx Ale rsaga.grid.calculus(in.grids = c("DSM_1.sgrd"),out.grid = "DCM_1_power15.sgrd", formula = ~^1.5) rsaga.grid.calculus(in.gr

Re: [R-sig-Geo] problem to convert gshhs to shapefile with R

2008-10-16 Thread Roger Bivand
On Thu, 16 Oct 2008, Yvan Le Bras wrote: Good afternoon. Excuse I for getting bored. I need to work with shapefile and I thank that was easy to convert gshhs to shapefile but since 2 weeks I tried without any success. Can you help me? I'd success to import gshhs file with importGSHHS from PBSmap

[R-sig-Geo] problem to convert gshhs to shapefile with R

2008-10-16 Thread Yvan Le Bras
Good afternoon. Excuse I for getting bored. I need to work with shapefile and I thank that was easy to convert gshhs to shapefile but since 2 weeks I tried without any success. Can you help me? I'd success to import gshhs file with importGSHHS from PBSmapping and Rgshhs from maptools but I don'

Re: [R-sig-Geo] geonames API for R

2008-10-16 Thread Edzer Pebesma
Looks great, Barry. I think to show the potential and to seduce people to start using this, it would be very valuable to add a few examples, preferably one for each of the items in http://www.geonames.org/export/ws-overview.html , or just the most dissimilar ones. Right now you assume that u

[R-sig-Geo] geonames API for R

2008-10-16 Thread Barry Rowlingson
After the initial query about finding timezones in R, I've gone mad and written an entire package for querying all of (well, most of) geonames.org. It's hosted on R-Forge: http://geonames.r-forge.r-project.org/ and recently submitted to CRAN. Install from the R-forge repo with: install.packages

Re: [R-sig-Geo] R+SAGA formula to subtract two raster

2008-10-16 Thread Alexander Brenning
Hi Alessandro, SAGA has a grid_calculus library. RSAGA provides a wrapper function rsaga.grid.calculus, and even rsaga.linear.combination as a more convenient version when you want to apply linear models to stacks of grids. See ?rsaga.grid.calculus, there's also some example code. Here some

Re: [R-sig-Geo] points on polygons

2008-10-16 Thread Roger Bivand
On Wed, 15 Oct 2008, Thomas Lumley wrote: On Wed, 15 Oct 2008, hadley wickham wrote: It's relatively easy to do this with ggplot2 (the tricky part is converting the polygons to a data frame) - I can provide some code if you're interested. That would be great. A direct spplot draft, av