Displaying 8 results from an estimated 8 matches for "coln".
Did you mean:
col
2006 Oct 24
0
plot(all.effects)
..., ncol=1, more=FALSE
so that I can plot multiple effect plots on one layout?
I was hoping that a call like
last <- rep(c(TRUE, FALSE), c(3, 1))
lay <-matrix(c(1:4,), 2, 2, byrow = T)
for(i in 1:4) {
tmp.lm <- lm(y ~ a + b, data)
spl <- which(lay == i, arr.ind = TRUE)
rowN = spl[1]
colN = spl[2]
plot(all.effects(tmp.lm), row = rowN, col = colN, nrow = 2, ncol =
2, more = last[i])
}
would work (my data are complicated, and have not had the time to set
up a replicable example).
Here is what I ran, and what R told me:
for(i in 1:4) {
tmp.lm <- lm(duration ~ (pitch + vis +...
2013 Mar 25
3
nested 'while' loops
...'m using the following code to go over every element of a data frame (row
wise). The problem I am facing is that the outer 'x' variable is not
incrementing itself, thus, only one row of values is obtained, and the
program does not proceed to the next row.
This is the code:
while(x<=coln)
{
while(y<=rown)
{
n<-as.numeric(df[[y]][x]);
if(n>0)
{
lim<-(n-1);
S<-100;
(...)
}
opdf[[y]][x]<-sum;
}
y<-y+1;
}
x<-x+1;
}
Here is a sample of the input data:
GENE A CD EF GH IK LM NP QR ST V...
2011 Apr 07
1
transform() on selective names. Is it possible?
Hi all,
I am whitening my data:
# code begins
N <- 300
M <- 2
x <- matrix(data=rnorm(N*M, 0, 3)-10, ncol=M, nrow=N)
y <- matrix(c(1,-2,-2,1), ncol=M, nrow=M)
z <- data.frame(x %*% y)
colnames(z) <- c('x','y')
par(mfrow=c(1,3))
plot(z, pch=5, col="blue")
whiten <- function(x) { (x-mean(x))/sd(x) }
zz <- transform(z, x=whiten(x), y=whiten(y))
plot(zz, pch=3, col="red")
#code ends
And everything looks fine enough.
But now I want to withe...
2009 Dec 14
1
as.data.frame requires a lot of memory (PR#14140)
...~33000 attributes) the
conversion to a data frame requires has to be killed at with 60gb of
memory usage while it should only require 17.6gb (2*8.8gb).
dfn <- rep(list(rep(0, 4096)), 4096)
test <- as.data.frame.list(dfn)
I also tried the incremental construction of the
data-frame: df$colN <- dataForColN. While I currently can't say much
about the memory usage, it takes a looong time.
After the construction the saved-and-loaded data-frame has the expected size.
What is the recommended way to construct larger data-frames?
2011 May 02
2
Lasso with Categorical Variables
Hi! This is my first time posting. I've read the general rules and
guidelines, but please bear with me if I make some fatal error in
posting. Anyway, I have a continuous response and 29 predictors made
up of continuous variables and nominal and ordinal categorical
variables. I'd like to do lasso on these, but I get an error. The way
I am using "lars" doesn't allow for the
2015 Feb 24
2
intercalar elementos de vectores
...#Creo un data.frame de ejemplo todo con letras
> > vtmp <- as.data.frame(lapply(letters,function(x) { rep(x,each=50) }))
> > names(vtmp) <- paste("col",LETTERS,sep="")
> > head(vtmp)
> colA colB colC colD colE colF colG colH colI colJ colK colL colM colN
> colO colP colQ colR colS colT colU colV colW colX colY colZ
> 1 a b c d e f g h i j k l m n
> o p q r s t u v w x y z
> 2 a b c d e f g h i j k l m n
> o p q...
2015 Feb 24
2
intercalar elementos de vectores
Excelente! Ahora corre muy rápido. No conocía ese método, creo que me va a
resultar muy útil.
Muchas gracias y saludos.
Fernando Macedo
El 24/02/15 a las 10:51, Jorge I Velez escribió:
Fernando,
Podrias intentar
R> a <- rep('a', 5)
R> b <- rep('b', 5)
R> a
[1] "a" "a" "a" "a" "a"
R> b
[1] "b"
2008 Mar 06
2
Help with parsing a data file
Hi All,
I need to parse data from a file, example shown below. The first two lines
can be skipped, the third line contains the column names. The next 13 lines
can be skipped. The next line "1991" is a year value, with the following 13
values data for that year. The file then repeats this format with (year, 13
lines of data for that year). I would ideally like to end up with an