rmMatrix {biology} | R Documentation |
~~ A concise (1-5 lines) description of what the function does. ~~
rmMatrix(data, v.names = NULL, idvar, repeated, drop = NULL, split = NULL)
data |
~~Describe data here~~ |
v.names |
~~Describe v.names here~~ |
idvar |
~~Describe idvar here~~ |
repeated |
~~Describe repeated here~~ |
drop |
~~Describe drop here~~ |
split |
~~Describe split here~~ |
~~ If necessary, more details than the description above ~~
~Describe the value returned If it is a LIST, use
comp1 |
Description of 'comp1' |
comp2 |
Description of 'comp2' |
...
....
~~further notes~~
~Make other sections like Warning with section{Warning }{....} ~
~~who you are~~
~put references to the literature/web site here ~
~~objects to See Also as help
, ~~~
##---- Should be DIRECTLY executable !! ---- ##-- ==> Define data, use random, ##-- or do help(data=index) for the standard data sets. ## The function is currently defined as function (data, v.names = NULL, idvar, repeated, drop = NULL, split = NULL) { r <- reshape(data, v.names = v.names, idvar = idvar, timevar = repeated, drop = drop, direction = "wide") rnames <- names(r) i <- match(idvar, rnames) r <- r[, -i] if (!is.null(split)) { r <- split(r, eval(parse(text = paste("r$", split, sep = "")))) for (i in 1:length(r)) { ii <- match(split, rnames) r[[i]] <- r[[i]][, -ii] r[[i]] <- as.data.frame(r[[i]]) } } else r <- as.data.frame(r) r }