Re: [R-sig-Geo] fix color scale

2010-11-07 Thread Hadley Wickham
+ coord_equal() Or if x and y are long and lat, + coord_map() Hadley On Sun, Nov 7, 2010 at 1:55 PM, Edzer Pebesma wrote: > Paul, this nicely illustrates the power of ggplot2. > > In the resulting plot, however, it seems to me that the > > + opts(aspect.ratio = 1) > > does not result in the des

Re: [R-sig-Geo] rgeos and Google Summer of Code

2010-06-15 Thread Hadley Wickham
>> For some reason the r-forge pages don't show anymore how r-forge >> packages can be installed. As they always did, I didn't bother to >> remember. Could you tell us, so we can alpha test, and perhaps add this >> to the rgeos page on r-forge? (Better would be someone repaired r-forge, >> which se

Re: [R-sig-Geo] How to extract coordinates values from a shapefile?

2010-06-09 Thread Hadley Wickham
On Wed, Jun 9, 2010 at 3:24 PM, Edzer Pebesma wrote: > The example provided by Matt assumes that each polygon consists of a > single ring, and doesn't have islands, lakes etc. The function below > pasts all coordinates to a single 2-column matrix. For clarity's sake, I > avoided nested sapply's. >

Re: [R-sig-Geo] Plotting SpatialPolygonsDataFrame using ggplot2

2010-04-27 Thread hadley wickham
Hi Paul, You're missing the group specification: ggplot(dum, aes(x = long, y = lat)) + geom_path(aes(group = group)) Hadley On Tue, Apr 27, 2010 at 4:17 AM, Paul Hiemstra wrote: > Hi people, > > I have a question regarding plotting a SpatialPolygonsDataFrame using > ggplot2. To convert the SPD

Re: [R-sig-Geo] Geocode for Bogota

2010-03-11 Thread hadley wickham
> They limit, however, the number of geocode requests to 15,000 in a 24 hour > period. If the url connection breaks, then it might be a good idea to run the > same loop one more time and set add a while command to look for the missing > coordinates. It's also against the terms of service to use

Re: [R-sig-Geo] Convert a list of N dataframes to N dataframes

2009-12-07 Thread hadley wickham
On Mon, Dec 7, 2009 at 1:06 PM, Mark Na wrote: > Hello, > > I have used the following command: > > datalist<-list(data1,data2,data3,data4,data5,data6) > > to make a list of my dataframes, which I then manipulated with these > commands: > > datalist<-llply(datalist,"LogDepth") > datalist<-llply(dat

Re: [R-sig-Geo] zip code map - huge files!

2009-04-26 Thread hadley wickham
the complexity >> of vectors like these. >> >> Cheers, >> Dylan >> >> On Sun, Apr 26, 2009 at 3:53 PM, hadley wickham wrote: >>> Hi Enrico, >>> >>> I have some code to do map generalisation (reducing map resolution >>> withou

Re: [R-sig-Geo] zip code map - huge files!

2009-04-26 Thread hadley wickham
ralize command in GRASS to reduce the complexity > of vectors like these. > > Cheers, > Dylan > > On Sun, Apr 26, 2009 at 3:53 PM, hadley wickham wrote: >> Hi Enrico, >> >> I have some code to do map generalisation (reducing map resolution >> without vis

Re: [R-sig-Geo] zip code map - huge files!

2009-04-26 Thread hadley wickham
Hi Enrico, I have some code to do map generalisation (reducing map resolution without visible loss in detail) at http://github.com/hadley/data-counties/tree/master. It's applied to counties data, but would be trivial (if slow) to modify to work with zip codes instead Hadley On Sun, Apr 26, 2009

Re: [R-sig-Geo] Extract coordinates from SpatialPolygonsDataFrame

2009-03-20 Thread hadley wickham
> It would be great if you could put your code > in the wiki > http://wiki.r-project.org/rwiki/doku.php?id=tips:spatial-data I don't mind if the code is put on the wiki, but I don't want to keep it up-to-date in to places, and people will be able to use it directly from the next release of ggplot2

Re: [R-sig-Geo] Extract coordinates from SpatialPolygonsDataFrame

2009-03-19 Thread hadley wickham
I have the following code in ggplot2 for turning a SpatialPolygon into a regular data frame of coordinates. You'll need to load ggplot2, and then run fortify(yoursp). fortify.SpatialPolygonsDataFrame <- function(shape, region = NULL) { attr <- as.data.frame(shape) # If not specified, split in

Re: [R-sig-Geo] Help to count in apply(...)

2009-03-13 Thread hadley wickham
On Fri, Mar 13, 2009 at 7:55 AM, Robert Hijmans wrote: > I think the solution is using 'merge' > > soil.fe <- data.frame( >  ID =c(1,1,1,1,2,2,3,3,4,5,5,5,5,5,9,9,9,9,9,9,10,10), >  K > =c(6.25,12.50,25.00,50.00,80.00,12.00,6.25,12.50,25.00,50.00,76.00,67.00,67.00,56.00,98.00,32.00,33.00,43.00,54

[R-sig-Geo] Map thinning/generalisation

2009-03-01 Thread hadley wickham
Hi all, Is anyone aware of any code for performing topologically consistent polygon thinning/simplification/generalisation in R? Hadley -- http://had.co.nz/ ___ R-sig-Geo mailing list R-sig-Geo@stat.math.ethz.ch https://stat.ethz.ch/mailman/listinfo/

Re: [R-sig-Geo] overlay 1D graph on a map or map image: van Langren data

2008-12-03 Thread hadley wickham
> Thanks very much, Hadley. However, it doesn't work for me, using > ggplot2_0.7, even when adding I'm not surprised - you'll need version 0.8 Hadley -- http://had.co.nz/ ___ R-sig-Geo mailing list R-sig-Geo@stat.math.ethz.ch https://stat.ethz.ch/ma

Re: [R-sig-Geo] overlay 1D graph on a map or map image: van Langren data

2008-12-03 Thread hadley wickham
On Wed, Dec 3, 2008 at 8:33 AM, Michael Friendly <[EMAIL PROTECTED]> wrote: > Hi > I'm working with some historical data on determinations of longitude used by > Michael F van Langren > in 1644 to draw what is believed to be the first graph of statistical data. > The values are estimates > of the d

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

2008-10-15 Thread hadley wickham
On Wed, Oct 15, 2008 at 6:06 PM, Thomas Lumley <[EMAIL PROTECTED]> wrote: > > > I am trying to draw a US map with color-coded cities superimposed on > color-coded states, showing survey results from the Behavioral Risk Factor > Surveillance System. You can see the sort of thing I'm trying to do at

Re: [R-sig-Geo] non symetric color scale

2008-09-17 Thread hadley wickham
For a start, have you looked at the output of seq(-0.032,0,0.0025)? I don't think it does what yo think it does. Hadley On Wed, Sep 17, 2008 at 7:30 PM, Marie-Anne C Serve <[EMAIL PROTECTED]> wrote: > I would like to create a color scale covering values from -0.032 to 0.0025 > with a neutral co

Re: [R-sig-Geo] unionSpatialPolygons - single polygon instead of multipart polygon

2008-09-14 Thread hadley wickham
On Sun, Sep 14, 2008 at 11:48 AM, Roger Bivand <[EMAIL PROTECTED]> wrote: > On Sun, 14 Sep 2008, hadley wickham wrote: > >> Hi All, >> >> I'm trying to figure out exactly what output unionSpatialPolygons >> gives me - it looks like it merges my singleton po

[R-sig-Geo] unionSpatialPolygons - single polygon instead of multipart polygon

2008-09-14 Thread hadley wickham
Hi All, I'm trying to figure out exactly what output unionSpatialPolygons gives me - it looks like it merges my singleton polygons into multi-polygons (see output of str below), but what I really want is just a single singleton polygon, containing the boundary of the unioned areas. How can I get

Re: [R-sig-Geo] How to convert results generated by "filled.contour" to shapefiles?

2008-09-12 Thread hadley wickham
> The filled.contour() is a different kind of function, essentially doing > almost everything in C, and passing nothing back. So I think the only > alternative is to build polygons from the contourLines() output by > intersecting with a bounding box, and then finding out which polygon > boundaries

Re: [R-sig-Geo] spplot with two rasters

2008-03-13 Thread hadley wickham
> > In the trellis panel functions, or in the direct plot/image/lines etc > > functions, you plot in data coordinates. The main thing that the plot > > and spplot methods in package sp control is the aspect ratio. How else > > do data coordinates differ from geographical coordinates when it com

Re: [R-sig-Geo] Shortest path around obstacles (OT)

2008-02-24 Thread hadley wickham
On Sun, Feb 24, 2008 at 12:46 AM, Don MacQueen <[EMAIL PROTECTED]> wrote: > This question is basically off topic, since it isn't truly an R > question, though it is certainly related to r-sig-geo. I ask here in > the hopes that someone can suggest a direction for me to look. > > I have a what is

[R-sig-Geo] Calculating map orientations

2008-01-28 Thread hadley wickham
Hi all, I was wondering if anyone knows how the default orientations are calculated in the mapproj package. I need this for my ggplot2 package because when you are drawing maps with multiple layers of data you (obviously) have to calculate the orientation over all data, not just the data points i

Re: [R-sig-Geo] semi-transparent layer with image()

2007-11-16 Thread hadley wickham
There's the alpha function in the ggplot2 package: plot(1:90, 1:90, pch=16, cex=2, col="red") points(1:90, 1:90, pch=16, cex=2, col=alpha(grey(90:1/90), 0.5)) Hadley On 11/16/07, Ingo Holz <[EMAIL PROTECTED]> wrote: > Hi, > > is there an easier way to get a semi-transparent grey-palette? > > p

Re: [R-sig-Geo] Adding R-square to linear regression

2007-07-20 Thread hadley wickham
On 7/20/07, Thomas Szegvary <[EMAIL PROTECTED]> wrote: > except for the R^2 symbol...I found that problem else where too, but have > no solution yet. Have a look at ?plotmath. Hadley ___ R-sig-Geo mailing list R-sig-Geo@stat.math.ethz.ch https://stat.

Re: [R-sig-Geo] Clines library

2007-05-31 Thread hadley wickham
You can now use contourLines in the grDevices package included with R. Hadley On 5/31/07, Andrew Niccolai <[EMAIL PROTECTED]> wrote: > I truly apologize, I just found the clines package. Thanks. > > > Andrew Niccolai > Doctoral Candidate > Yale School of Forestry > >