Re: [R] add single points to a level plot

2018-03-08 Thread lily li
Thanks. Now it can run and generate plots, but there are the two lines on each of the plots. I don't know the problem for this? Error using packet 1 any(sp) is not TRUE On Thu, Mar 8, 2018 at 8:48 AM, Eric Berger wrote: > You need to load the package 'rasterVis' > > > library(rasterVis) > > H

Re: [R] add single points to a level plot

2018-03-08 Thread Jeff Newmiller
library(sos) findFn( "layer" ) findFn( "levelplot" ) Also, experts in spatial analysis tend to answer questions on the special mailing list where the Posting Guide says they should. Read it to find out where that is. -- Sent from my phone. Please excuse my brevity. On March 8, 2018 7:11:34 AM

Re: [R] add single points to a level plot

2018-03-08 Thread Eric Berger
You need to load the package 'rasterVis' > library(rasterVis) HTH, Eric On Thu, Mar 8, 2018 at 5:11 PM, lily li wrote: > Hi all, > > I ran the code: > > s <- stack(replicate(2, raster(matrix(runif(100), 10 > > xy <- data.frame(coordinates(sampleRandom(s, 10, sp=TRUE)), > +

Re: [R] add single points to a level plot

2018-03-08 Thread lily li
Hi all, I ran the code: > s <- stack(replicate(2, raster(matrix(runif(100), 10 > xy <- data.frame(coordinates(sampleRandom(s, 10, sp=TRUE)), + z1=runif(10), z2=runif(10)) > levelplot(s, margin=FALSE, at=seq(0, 1, 0.05)) + + layer(sp.points(xy, pch=ifelse(pts$z1 < 0.5, 2, 3),

Re: [R] Names of variables needed in newdata for predict.glm

2018-03-08 Thread Marc Schwartz
Hi Bendix, If the 'model' argument to glm() is TRUE (the default), you can get the structure of the model frame that was used to fit the model, by using: > str(mx$data) 'data.frame': 200 obs. of 4 variables: $ D: int 0 1 0 1 1 0 1 1 1 1 ... $ x: num 0.705 2.15 0.572 1.249 0.807 ... $ f: