Re: [R] Problems with plot maps

2012-12-12 Thread Pascal Oettli
Hello, I cannot reproduce the error: > library(ggplot2) Attaching package: 'ggplot2' The following object(s) are masked from 'package:latticeExtra': layer > library(cshapes) Loading required package: maptools Loading required package: foreign Checking rgeos availability: TRUE Loading req

[R] Problems with plot maps

2012-12-12 Thread Vasilchenko Aleksander
Hello, I need plot map using ggplot() I use such code: library("ggplot2") library(cshapes) cshp.data <- cshp() map <- cshp.data[cshp.data$COWCODE==369,] map_mp<- list( geom_polygon(aes(long, lat, group = group), data = map, fill = "grey70", colour = "grey60", inherit.aes = FAL

Re: [R] problems with plot()

2010-07-19 Thread Dennis Murphy
Hi: As Duncan noted, your approach is at best inefficient. Consider the following example: # Generate some fake data: x <- data.frame(x = rpois(10, 5), y = rnorm(10)) # Generate a list where each component is a row of x l <- split(x, rownames(x)) # verify it's a list l # class of each list compo

Re: [R] problems with plot()

2010-07-19 Thread Duncan Murdoch
On 19/07/2010 5:47 PM, math_daddy wrote: I have a list of vectors of length 2, each representing a point in 2-space, and each of which I wish to plot on the current plot. In a loop, I assign the x and y coordinates of the current element of the list to variables 'x' and 'y' respectively, then m

[R] problems with plot()

2010-07-19 Thread math_daddy
I have a list of vectors of length 2, each representing a point in 2-space, and each of which I wish to plot on the current plot. In a loop, I assign the x and y coordinates of the current element of the list to variables 'x' and 'y' respectively, then make a call to plot as follows: par(new = T