search for: colf

Displaying 3 results from an estimated 3 matches for "colf".

Did you mean: col
2010 Jan 29
1
apply function with grouped columns
...5) v3 <- c(3, 2, 9, 4) v4 <- c(4, 1, 1, 1) myData <- data.frame(v1=v1, v2=v2, v3=v3, v4=v4) myData #The observations have either property 1 or property 2 rowFactor <- data.frame(RowTraits=factor(c(1, 2, 1, 2))) rowFactor #The variables have a property that is either present or absent colFactor <- data.frame(ColTraits=factor(c(1, 1, 0, 0))) colFactor #Getting the means for the columns by row groups is easy MeanByRowTraits <- aggregate (myData, rowFactor[1], mean) MeanByRowTraits #But now to get the means for the rows by column groups is awkward rotateData <- data.frame(t(M...
2015 Feb 24
2
intercalar elementos de vectores
...la > tabla que tienes: > > > #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...
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"