search for: zcol

Displaying 20 results from an estimated 23 matches for "zcol".

Did you mean: col
2005 May 26
1
PAN: Need Help for Multiple Imputation Package
...six times. Approximately 25% of participants dropped out at end. > sim <- read.xport('c:\\xptds.dat') > > int <- rep(1,1200) > y <- cbind(sim$MIY1,sim$TCOV1) > subj <- sim$ID > pred <- cbind(int, sim$TIME, sim$GROUP) > > xcol <- 1:3 > zcol <- 1 > prior <- list(a=2,Binv=4,c=2,Dinv=4) > result <- pan(y,subj,pred,xcol,zcol,prior,seed=13579,iter=1000) Error: subscript out of bounds By the way, I also received the same error message when I tried to include intercept and time in Zcol, a matrix for random effect specifica...
2011 Dec 31
2
How to color a region in a contour plot with the contour being the boundary?
...of just the region for z <= 0.02). How can I solve this? Cheers, Marius ## z values for given x and y f <- function(x) 4*((1-x)^(-1/2)-1) eps <- 1e-12 x <- y <- seq(eps, 1-eps, length.out=500) z <- outer(x, y, FUN=function(x, y) pmax(f(x) + f(y) - 10, 0)) ## determine colors zcols <- c(gray(0.2), gray(seq(0.5, 1, length.out=50)), rep("#FFFFFF", max(z)-51)) # colors with dark gray in the beginning for z <= 0.02 and many whites for z > 50 ## trial 1 pdf(file="levelplot1.pdf", width=6, height=6) image(x, y, z, xaxs="r", yaxs="r&quot...
2005 Nov 03
0
problems with pan(): Indizierung ausserhalb der Grenzen = subscript out of bounds
...6 6 6 6 5 6 6 6 6 6 6 6 5 6 6 6 5 6 6 6 6 6 6 6 > pred <- cbind(interc=rep(1,dim(y)[1])) # just intercept (at first) > dim(pred) [1] 940 1 xcol <- 1:dim(pred)[2] > xcol [1] 1 #xcol = 1 , using all number of cols of pred[] > zcol <- c(1) # = 1 , number of cols to use > y.ncol <- dim(y)[2] > n.zcol <- length(zcol) > prior <- list(a=y.ncol, + Binv=diag(y.ncol), + c=n.zcol, + Dinv=diag(n.zcol)) > prior $a [1] 15 $Binv [,1] [,2] [,3] [,4] [,5] [,6] [,7...
2011 May 06
1
How to alter circle size
...ure of what to add or change in order to achieve that goal. panel.corrgram.2 = function(x, y, z, subscripts, at = pretty(z), scale = 0.8, ...) { require("grid", quietly = TRUE) x <- as.numeric(x)[subscripts] y <- as.numeric(y)[subscripts] z <- as.numeric(z)[subscripts] zcol <- level.colors(z, at = at, ...) for (i in seq(along = z)) { lims <- range(0, z[i]) tval <- 2 * base::pi * seq(from = lims[1], to = lims[2], by = 0.01) grid.polygon(x = x[i] + .5 * scale * c(0, sin(tval)), y = y[i] + .5 * scale * c(0, cos(tval)), default.units =...
2011 Jun 21
0
R crash when using pan for multiple imputation
...#specify the variables to be used for imputation                                                     pred <- matrix( rep( 1 , nrow(y) ) , ncol= 1)               #specify predictor matrix xcol <- 1                                                               #col with fixed effect in pred zcol <- 1                                                               #col with random effect in pred  prior <- list( a=ncol(y),                                           #non-informative prior                      Binv= diag( rep(1,ncol(y) ) ) ,                      c= ncol(y) * length(zcol)...
2012 Jan 27
1
Overimposing one map in ssplot onto another
...untry="CAN", level=2) ### B. Creating Map1- with borders between provinces: can1 at data[["groups"]]<-1 # want all provinces to have the same color, but ideally I'd like the whole map to be transparent. can1 at data$groups<-as.factor(can1 at data$groups) spplot(can1,zcol="groups",col.regions="white",colorkey = FALSE, lwd=.4, # col='white', par.settings = list(axis.line = list(col='transparent'))) ### C. Creating Map2- with borders between colored counties: # Creating an (artificial) grouping of Canadian admin units: nrofunits...
2005 Aug 31
0
Imputation using Pan in R
...ed well. The next step for me is to imputate a model with one y variable and both random intercept and slope. The program ran well, but did not imputate any of my missing values. I attached my codes in the following. Did I do anything wrong in the codes? I am confused with the setting of xcol and zcol (and of course the "pred"). Do anyone know how to set these matrices when including both random intercept and slope or when having 2 or more y's? Any suggestions would be appreciated. Thanks! Yi-fu >library(pan) > y <- c(5,8,NA,10, + 2,NA,NA,NA, + 10,10,8,NA...
2010 Feb 08
1
Color intervals in image.plot function
Hi, The script below is my current coding in order to produce a contour plot of temperature across altitude and time. In my case,?time,altitude and temperature?are represented by x, y and z variables. ############################################## Brazilan.Pallete <- colorRampPalette(c("blue","green","yellow","red")) image.plot(x, y, z, col =
2003 Aug 21
2
levelplot behaviour for panel with constants
In the example: x = rep(c(0,0,1,1),4) y = rep(c(0,1,0,1),4) z = c(1,0,1,0,0,0,1,1,0,1,0,0,1,1,1,1) f = as.factor(c(rep("a",4),rep("b",4),rep("c",4),rep("d",4))) levelplot(z~x+y|f,data.frame(x=x,y=y,z=z,f=f)) I noted that the last ("d") plot remains empty. I guess the reason for this is that the values are constant (1), but I consider it more
2007 Sep 20
2
Superimposing vector polygons over raster grid in a plot
Hello: I would like to superimpose vector polygons (state outlines) from a Shape file on top of a satellite image, imported into a SpatialGridDataFrame from GEOTIFF via gdal_translate and readGDAL. When I plot polygon and point shape files in R, into SpatialPointDataFrame and SpatialPolygonDataFrame, the two feature sets line up geographically, so it seems logical that a SpatialGridDataFrame
2003 Jan 21
1
[R] proposal: lattice/levelplot: panel.catlevelplot
...ay categorical data. I append the proposed code and two examples: - panel.catlevelplot() - example1.catlevelplot.esoph() - example2.catlevelplot.esoph() Wolfram Fischer #------ CODE -------------------------------------------------------------- panel.catlevelplot <- function (x, y, z, wx, wy, zcol, col.regions, subscripts , ... , z.factor.min = 0.02 # factor for z range expansion # -> little cells become visible , col.x = NULL # colors for categories in x direction , col.y = NULL # colors for categories in y direction , p...
2003 Feb 06
1
Réf. : About STEM Plot in R
hello, you can use the persp() function. The shade=0.7 option is very nice. With matlab, it is possible to change of colors automaticalli with the value to be plotted. Does someone know to do that ? Gr?gory f0z6305 at labs.tamu.edu@stat.math.ethz.ch on 06/02/2003 07:05:04 Envoy? par : r-help-admin at stat.math.ethz.ch Pour : r-help at stat.math.ethz.ch cc : Objet : [R] About
2007 Oct 08
1
do not plot polygon boundaries with spplot {sp}
Hi, Is there a simple way to suppress the plotting of polygon boundaries with spplot() ? # simple list of 12 colors cols <- brewer.pal(12, "Paired") # plot pile of polygons, with 12 classes: spplot(x, zcol='class2', col.regions=cols, scales=list(draw=T), xlab="Easting (m)", ylab="Northing (m)") ... seems to work well. However the polygon boundaries are colored black. If possible I would like the boundaries to not be drawn at all. any tips? cheers, Dylan -- Dylan Be...
2007 Sep 24
0
longitudinal imputation with PAN
...ctor(impht.data$sex,label = c("Boys","Girls")) impht.data$visit <- factor (impht.data$visit) impht.data$code <- factor (impht.data$code) y <- impht.data$htmiss subj <- impht.data$code pred <- cbind (impht.data$age, impht.data$sex, impht.data$visit) xcol <- 1:3 zcol <- 1 prior <- list(a=1, Binv=1, c=1, Dinv=1) ht1 <- pan(y, subj, pred, xcol, zcol, prior, seed=13579, iter=1000) code sex visit age ht htmiss 1 2 1 4.87 105 105 1 2 2 5.86 109.6 1 2 3 6.88 116.4 116.4 1...
2011 Mar 05
3
Change panel background color in spplot()
Hi! How does one change the background color of the map-panel in spplot()? Example: library(sp) data(meuse.grid) gridded(meuse.grid) = ~x+y spplot(meuse.grid, "part.a") How would I get another background-color for the map-panel (but not for the whole plot) here? Thank you! Marcel
2006 Dec 01
1
memeory problem?!
...t;longc","slope_n","profc","minic","maxic") print("perform the clustering") morph.clara <- clara(morph, k=5, stand=F) x$morph_class <- morph.clara$clustering print("send result back to GRASS") rast.put6(x,"morph", zcol="morph_class") during the step : ....perform the clustering after a lot of time, i've this error: Errore in sprintf(fmt, ...) : La lunghezza della stringa eccede la dimensione del buffer di 8192 Inoltre: Warning messages: 1: perl = TRUE ?? implementato solo nei locale UTF-8 2...
2006 Dec 01
1
memory problem
...t;longc","slope_n","profc","minic","maxic") print("perform the clustering") morph.clara <- clara(morph, k=5, stand=F) x$morph_class <- morph.clara$clustering print("send result back to GRASS") rast.put6(x,"morph", zcol="morph_class") during the step : ....perform the clustering after a lot of time, i've this error: Errore in sprintf(fmt, ...) : La lunghezza della stringa eccede la dimensione del buffer di 8192 Inoltre: Warning messages: 1: perl = TRUE ?? implementato solo nei locale UTF-8 2:...
2004 Sep 21
1
bubble plots
...;NFi" I do: > levels(data$etat) <- c(0, 2, -2, 1, -1) > data$etat <- as.numeric(as.vector(data$etat)) > C1 <- subset(data, sub=="C" & bloc=="1", select=c(x, y, etat)) > x11() > lset(theme = col.whitebg()) > bubble(C1, xcol = 1, ycol = 2, zcol = 3, xlab = "", ylab = "", main = "Bloc 1 - Substrat C", key.entries = min(C1[, 3]):max(C1[, 3]), maxsize=3) I then obtain "-2", "-1", "O", etc. as legend labels and cannot find argument making it possible to label my legend with init...
2011 Oct 21
0
add=TRUE or similar in spplot?
...#39;spRiverDf'. The data frame consists of numbers {0,1,...,5}. And I have a vector 'colorS' of length 6 with different colours. If I make a plot with spplot I get a plot of the lines - colours depending on there number in the data frame column: spplot(spRiverDf['data.col.1'], zcol=..., names.attr=..., col.regions=colorS, lwd=10) # (A) My problem: - I'd like to overlay narrow lines (lwd=5) with the appropriate colors of a second data column. My tests: 1) I tried it with the spplot options: lwd=10, sp.layout=list(list(spRiverDf['data.col.2'], col=colorS, lwd=5))...
2012 Feb 15
0
spplot settings
I want to use spplot function for plotting data on wold map spplot.points(obj, zcol = names(obj), ..., names.attr, scales = list(draw = FALSE), xlab = NULL, ylab = NULL, aspect = mapasp(obj,xlim,ylim), panel = panel.pointsplot, sp.layout = NULL, identify = FALSE, formula, xlim = bbexpand(bbox(obj)[1, ], 0.04), ylim = bbexpand(bbox(obj)[2, ], 0.04)) in this function I would...