search for: colvar

Displaying 20 results from an estimated 29 matches for "colvar".

Did you mean: colvars
2017 Jun 29
0
plot3D color ramp not working as expected
Hi, I want to use a discrete color ramp with plot3D, and show NA values as white (default). I get unexpected results per the following. # as in help(slice3D) example: par(mfrow = c(2,2)) x <- y <- z <- seq(-1, 1, by = 0.1) grid <- mesh(x, y, z) colvar <- with(grid, x*exp(-x^2 - y^2 - z^2)) slice3D (x, y, z, colvar = colvar, theta = 60) # # use three discrete classes and colors instead of a continuous ramp slice3D(x, y, z, colvar = colvar, theta = 60, col = c("blue", "green", "red"), breaks = c(-0.5, -0.1,...
2003 Feb 12
1
models for square tables
I've posted a sample file for estimating loglinear models for square tables (mobility models) at http://www.xs4all.nl/~jhckx/mcl/R/ Comments and suggestions are welcome. John Hendrickx
2015 Jan 16
1
S3 generic method dispatch on promises
Dear R friends I wanted a function to make a simple percent table that would be easy for students to use. The goal originally was to have a simple thing people would call like this pctable(rowvar, colvar, data) and the things "rowvar" and "colvar" might be names of variables in data. I wanted to avoid the usage of "with" (as we now see in the table help). Then some people wanted more features, and I agreed with the suggestion to create a formula interface that people...
2002 Aug 14
3
t-test via matrix operations
I need to calculate a large number of t statistics, and would like to do so via matrix operations. So far I have figured out a way to calculate the mean of each row of the matrix: d <- matrix(runif(100000,1,10), 1000, 10) # some test data s <- rep(1,ncol(d)) # a sum vector to use for matrix multiplication means <- (d%*%s)/ncol(d) This is at least 1 order of magnitude faster than
2000 Jul 07
1
reorganizing a data frame
Hi, I have what I think is an easy question. I have a data frame, called stockdata, of stock prices that looks like this: date ticker close 1 01/02/1998 GE 24.667 2 01/05/1998 GE 25.104 3 01/06/1998 GE 24.771 4 01/07/1998 GE 24.979 5 01/08/1998 GE 24.750 6 01/02/1998 HIT 71.125 7 01/05/1998 HIT 72.313
2007 Jan 24
3
Cronbach's alpha
Dear Listers: I used cronbach{psy} to evaluate the internal consistency and some set of variables gave me alpha=-1.1003, while other, alpha=-0.2; alpha=0.89; and so on. I am interested in knowing how to interpret 1. negative value 2. negative value less than -1. I also want to re-mention my previous question about how to evaluate the consistency of a set of variables and about the total
2002 Jan 07
0
New package: colSums
I've uploaded a package colSums_1.0.tar.gz to CRAN /src/contrib/Devel. It contains functions colSums, colMeans, colVars, colStdevs, rowSums, rowMeans, rowVars, and rowStdevs. These do simple, fast arithmetic on columns/rows of a matrix, or more generally across dimensions of an array, e.g. colSums(m) = apply(m, 2, sum) but faster. They should be compatible with the corresponding S-Plus functions. The core code w...
2017 Jun 21
0
customizing color key with plot3D
...t;m"), bty = "f", plot = FALSE) elev.classes <- matrix(findInterval(volcano, vec = seq(50, 200, by=50)), nrow=nrow(volcano), ncol=ncol(volcano)) class.colors <- c("red", "blue", "green") # add as image with own color key, at bottom image3D(z = -60, colvar = elev.classes, add = TRUE, col = class.colors, #breaks = seq(0.5, 3.5, by=1), clim=c(1,3), colkey = list(length = 0.2, width = 0.4, shift = -0.15, cex.axis = 0.8, cex.clab = 0.85, addlines=TRUE, tick=FALSE, at = c(1.33, 2, 2.66)...
2012 Mar 06
11
Buscando la solución más eficiente para generar resultados a partir de un list
Hola:   Tengo una lista de 2 elementos, cada uno de los cuales contiene información relativa a un sujeto (Pablo y Carlos).   lSujetos <- list() lSujetos[[1]] <- list(nomfich="Pablo", colTime=5, colVars=c(6,7,8)) lSujetos[[2]] <- list(nomfich="Carlos", colTime=5, colVars=c(6,7,8)) A continuación, leo las series temporales correspondientes a cada individuo. En este caso leo, para cada individuo, las series correspondientes a las columnas de las posiciones 6, 7 y 8 en el fichero:   mi...
2002 Mar 17
5
compute variance of every column in a matrix without a loop
Is it possible to compute the variance of every column in a matrix without a loop? -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch
2009 May 13
5
Help with reshape/reShape and indexing
...able X1 values populate the resulting rows in df2 from left to right (i.e. if only one value is available, it is written in the first column and the remaining columns get NAs). If I could generate the Index column, I think I could accomplish this with: df2 = reShape(df.index$X1, id=df.index$Name, colvar=df.index$Index) colnames(df2) = c("V1", "V2", "V3") However, is there a way to get to df2 without using the Index column and still have the NAs written as described above? Thank you so much for your help on these two issues. With best regards, Dana Sevak
2011 May 31
1
reshape::cast: invalid 'yinds' argument
...v, id + code + productname + year + begin + end + specificDesc + specificDesc2 ~ type) Error in merge.data.frame(data, all.combinations, by = unlist(vars), sort = FALSE, : invalid 'yinds' argument What does this message mean, and how can I get rid of the error? I tried changing the colvars from character to factor, but that didn't help. I'm using R2.10.1 and either WinXP or Win2000. Thanks in advance, Albert-Jan ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ All right, but apart from the sanitation, the medicine, education, wine, public order, i...
2004 Jun 09
1
Re: R equivalent of Splus rowVars function
...) is used (it's slower but more accurate). In real life I set the "twopass" default to FALSE, because in finance noise is always bigger than signal. I am cc'ing to R-help, as this is really an R question. -- -- David Brahm (brahm at alum.mit.edu) colVars <- function(x, na.rm=FALSE, dims=1, unbiased=TRUE, SumSquares=FALSE, twopass=TRUE) { if (SumSquares) return(colSums(x^2, na.rm, dims)) N <- colSums(!is.na(x), FALSE, dims) Nm1 <- if (unbiased) N-1 else N if (twopass) {x <- if (dims==length(dim(x))) x - mean(...
2002 Nov 15
2
Why no colSDs etc
Hi people, If there is a fn "colMeans" why isn't there a "colSDs" etc Thanks, Phil. -- Philip Rhoades Pricom Pty Limited (ACN 003 252 275) GPO Box 3411 Sydney NSW 2001 Australia Mobile: +61:0411-185-652 Fax: +61:2:8923-5363 E-mail: pri at chu.com.au -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read
2001 Oct 03
8
Several R vs S-Plus issues
...number of arguments It failed because no ... was given. Fortunately, this is easily patched: R> myfun <- function(x, ...) {if (missing(...)) x[]<-0 else x[...]<-0; x} 4) Missing functions: a) identical() [scheduled for 1.4.0] b) slice.index() c) rowSums(), colSums(), colVars(), etc. d) unpaste() - R has strsplit, whose result is like the transpose of unpaste 5) rowsum() gives character dimnames in S, factor numbers in R. I've reported this early, and Brian D. Ripley promised a fix in 1.4.0. OK, the rest are just differences, not complaints. In fact, som...
2001 Oct 03
8
Several R vs S-Plus issues
...number of arguments It failed because no ... was given. Fortunately, this is easily patched: R> myfun <- function(x, ...) {if (missing(...)) x[]<-0 else x[...]<-0; x} 4) Missing functions: a) identical() [scheduled for 1.4.0] b) slice.index() c) rowSums(), colSums(), colVars(), etc. d) unpaste() - R has strsplit, whose result is like the transpose of unpaste 5) rowsum() gives character dimnames in S, factor numbers in R. I've reported this early, and Brian D. Ripley promised a fix in 1.4.0. OK, the rest are just differences, not complaints. In fact, som...
2012 Mar 09
0
Rv: Re: Buscando la solución más eficiente para generar resultados a partir de un list
...yahoo.es> escribió: > > Hola: > > > > Tengo una lista de 2 elementos, cada uno de los cuales contiene > > información relativa a un sujeto (Pablo y Carlos). > > > > lSujetos <- list() > > lSujetos[[1]] <- list(nomfich="Pablo", colTime=5, colVars=c(6,7,8)) > > lSujetos[[2]] <- list(nomfich="Carlos", colTime=5, colVars=c(6,7,8)) > > > > A continuación, leo las series temporales correspondientes a cada > > individuo. En este caso leo, para cada individuo, las series > > correspondientes a las column...
2007 May 18
1
svychisq
...a.rm=TRUE),"C hisq") It is throwing up an error message as follows: Error in NCOL(y) : only 0's may be mixed with negative subscripts In addition: Warning messages: 1: is.na() applied to non-(list or vector) in: is.na(rowvar) 2: is.na() applied to non-(list or vector) in: is.na(colvar) The dietperception data set does have some NA's where as there are none in dietstatus. The table is svytable(~dietperception+dietstatus,dudleyls1rake) dietstatus dietperception Good OK Poor Very Poor Unclassified Perceive healt...
2008 Jan 24
0
deprecate "freq" argument to hist
...in R packages that are loaded by default, hist.default is the only one I found with a "freq" argument. -------------------------------------------------- These functions have both "weights" and "freq" arguments in S-PLUS: hist rowMeans rowSums rowVars colMeans colSums colVars colQuantiles cor, var, stdev density skewness, kurtosis qqline qqnorm.default quantile Some others have "weights" but not (yet) "freq", including mean median ppoints tabulate. Other functions like lm have always had a weights argument. ---------------------------------------...
2017 Jun 21
0
customizing color key with plot3D
...classify the volcano elevations with 3 classes elev.classes <- matrix(findInterval(volcano, vec = seq(50, 200, by=50)), nrow=nrow(volcano), ncol=ncol(volcano)) class.colors <- c("red", "blue", "green") # add as image with own color key, at bottom image3D(z = -60, colvar = elev.classes, add = TRUE, col = class.colors, breaks = seq(0.5, 3.5, by=1), colkey = list(length = 0.2, width = 0.4, shift = -0.15, cex.axis = 0.8, cex.clab = 0.85, addlines=TRUE, tick=FALSE, at = 1:3, labels=paste("Class", 1...