[R] (no subject)

Phil Spector spector at stat.berkeley.edu
Mon Feb 21 20:58:17 CET 2011


Please start R and enter the following commands:

library(splancs)
area = 6*4
lambda = 1.5
N = rpois(1,lambda*area)
u = runif(N,-2,4)
v = runif(N,0,4)
h = chull(u,v)
h = c(h,h[1])
plot(u[h],v[h],"l",asp=1)
points(u,v)

If you do not get the plot you're expecting, then
repost
   1) adding an informative subject line
   2) showing us what you tried without including
      your typos and other errors.

I think you'll find this a more effective strategy than
trying to replace core elements of R that you don't
understand with empty functions.

 					- Phil Spector
 					 Statistical Computing Facility
 					 Department of Statistics
 					 UC Berkeley
 					 spector at stat.berkeley.edu


On Mon, 21 Feb 2011, Schmidt, Lindsey C (MU-Student) wrote:

> What is plot.new? and how can i get it to work so i can load other data?
>
>> library(splancs)
>> area = 6*4
>> lambda = 1.5
>> N = rpois(1,lambda*area)
>> u = runif(N,-2,4)
>> v = runif(N,0,4)
>> plot(u,v,asp=1)
>> h = chull(u,v)
>> h = c(h,h[1])
>> plot(u[h],v[h],"1",asp=1)
> Error in plot.xy(xy, type, ...) : invalid plot type '1'
>> plot(u[h],v[h],"l",asp=1)
>> points(u,v)
> Error in plot.xy(xy.coords(x, y), type = type, ...) :
> plot.new has not been called yet
>> pts=as.points(u,v)
>> pointmap(pts)
>> hullpoly=as.points(u[h],v[h])
>> polymap(hullpolly,add=TRUE)
> Error in xy.coords(x, y) : object 'hullpolly' not found
>> help(polymap)
>> help(plot.net)
> No documentation for 'plot.net' in specified packages and libraries:
> you could try '??plot.net'
>> help(plot.new)
>> plot(u[h],v[h],"l",asp=1)
>> plot.new(u,v)
> Error in plot.new(u, v) : unused argument(s) (u, v)
>> plot.new()
>> points(u,v)
> Error in plot.xy(xy.coords(x, y), type = type, ...) :
> plot.new has not been called yet
>> plot.new(u,v)
> Error in plot.new(u, v) : unused argument(s) (u, v)
>> plot.new(xy.coords(x,y))
> Error in plot.new(xy.coords(x, y)) : unused argument(s) (xy.coords(x, y))
>> plot.new(uv.coords(u,v))
> Error in plot.new(uv.coords(u, v)) : unused argument(s) (uv.coords(u, v))
>> plot.new <- function()
> + {}
>> { }
> NULL
>> plot.new <- function()
> + { }
>> { }
> NULL
>> { for }
> Error: unexpected '}' in "{ for }"
>> area = 60*20
>> lambda = 2
>> N = rpois(1,lambda*area)
>> u = runif(N,20,40)
>> v = runif(N,-10,10)
>> plot(u,v,asp=1)
>>
>> plot(u,v,asp=1)
>> u = runif(N,20,40)
>> v = runif(N,-10,10)
>> plot(u,v,asp=1)
>>
>> plot(u,v,asp=1)
>> u = runif(N,20,40)
>> v = runif(N,-10,10)
>> plot(u,v,asp=1)
>> u = runif(N,20,40)
>> v = runif(N,-10,10)
>> plot(u,v,asp=1)
>> h = chull(u,v)
>> h = c(h,h[1])
>> plot(u[h],v[h],"l",asp=1)
>> points(u,v)
> Error in plot.xy(xy.coords(x, y), type = type, ...) :
> plot.new has not been called yet
>> pts=as.points(u,v)
>> pointmap(pts)
>> hullpoly=as.points(u[h],v[h])
>> polymap(hullpolly,add=TRUE)
> Error in xy.coords(x, y) : object 'hullpolly' not found
> No help files found matching ‘hullpoly’ using fuzzy matching
>> pointmap(as.points(hullpoly), add=TRUE)
> Error in plot.xy(xy.coords(x, y), type = type, ...) :
> plot.new has not been called yet
>> hullpoly=as.points(u[h],v[h])
>> polymap(hullpoly$poly, add=TRUE)
> Error in hullpoly$poly : $ operator is invalid for atomic vectors
>> polymap(hullpoly,add=TRUE)
> Error in polygon(poly, ...) : plot.new has not been called yet
>> plot.new()
> NULL
>> par(new=TRUE)
> Warning message:
> In par(new = TRUE) : calling par(new=TRUE) with no plot
>> plot.new()
> NULL
>> par(new=TRUE)
> Warning message:
> In par(new = TRUE) : calling par(new=TRUE) with no plot
>> new.u=runif(50,20,40)
>> new.v=ruinf(50,-10,10)
> Error: could not find function "ruinf"
>> new.v=runif(50,-10,10)
>> pts.in=pip(as.points(new.u,new.v),hullpoly,out=FALSE)
>> pointmap(pts.in,col="red",add=TRUE)
> Error in plot.xy(xy.coords(x, y), type = type, ...) :
> plot.new has  not been called yet
> ______________________________________________
> R-help at r-project.org mailing list
> 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.
>


More information about the R-help mailing list