Skip to content

fixed colors in maps (Katona Lajos)

3 messages · Edzer Pebesma, Alok K. Bohara, PhD, Paulo Cardoso

#
Dear all,

I've uploaded a new sp version to /incoming on CRAN (0.9-29) where 
spplot should deal better with factors as dependent variables. As 
levelplot does not really have this functionality, it involved a bit of 
work on the spplot side.

Now, spplot checks that all factors in layers (panels) have the same 
levels; I cannot see use of paneled plots for factors having different 
levels; this means that the example Jon Loehrke gave, to which I reacted 
with a note that the resulting plot was wrong on

https://stat.ethz.ch/pipermail/r-sig-geo/2008-December/004729.html

now breaks with an error condition. Please convince me if you think this 
is bad design.

Also, when plotting factors, the length of the col.regions color ramp 
now needs to equal the number of factor levels. An exception is when 
plotting points; in this case a single color is also accepted (because 
you may want to use point symbols to distinguish classes). The default 
color setting for factors is still that for continuous variables (the 
cm.colors() default of lattice); I'm quite unhappy about this but am 
also reluctant to make sp dependent on RColorBrewer.

Please test & comment; happy new year!
--
Edzer
Katona Lajos wrote:
meuse$color_codes=as.numeric(meuse$ffreq)+as.numeric(meuse$soil)+as.numeric(meuse$lime)
first 3
between 6 and

  
    
1 day later
#
Hi all:

I am trying to use spatstat ppm command to estimate a poisson model with 
a covariate. It gives me an error: (I am new to R)

Error in mpl.get.covariates(covariates, P, Pname) :
Number of rows in ?covariates? does not equal the number of quadrature 
points

1. I have created a point pattern dataset ppp with a polygon as window 
(using NC as a state, for example).

x1 <- rawdata$NWBIR74
U <- cbind(x,y,x1)
U <- as.data.frame(U)
Q <- quadscheme(X, dummy=list(x=U$x, y=U$y))
#where X is created using a ppp command with NC polygon as an window "owin"
# gave me many errors saying that I have duplicates...
## So I used this to extract unique elements as suggested somewhere
xu2 <- X[!duplicated(X)]
Q <- quadscheme(xu2, dummy=list(x=U$x, y=U$y))
## I also tried this:
#xu2 <- x[!duplicated(x, fromLast = TRUE)]

df <- data.frame(x11=c(x1, U$x11))
#For some reason df is a vector and NOT a matrix (I don;t know if this 
is what it needs to be??)
ppm(Q, ~ x11, Poisson(), covariates=df)
Error in mpl.get.covariates(covariates, P, Pname) :
Number of rows in ?covariates? does not equal the number of quadrature 
points

Thanks

Alok Bohara
Professor
UNM
#
Hi,
adehabitat package functions for analysis of home range in animal ecology
provide graphical and tabular outputs nevertheless there is no apparent
connection to truly georeferenced data (positions).
I'd like to know if it's possible to convert adehabitat spatial outputs
(like convex polygons, kernel areas) to georegistered shapefiles.
Thanks in advance
____________
Paulo E. Cardoso