rmMatrix {biology}R Documentation

~~function to do ... ~~

Description

~~ A concise (1-5 lines) description of what the function does. ~~

Usage

rmMatrix(data, v.names = NULL, idvar, repeated, drop = NULL, split = NULL)

Arguments

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~~

Details

~~ If necessary, more details than the description above ~~

Value

~Describe the value returned If it is a LIST, use
comp1 Description of 'comp1'
comp2 Description of 'comp2'
...

Note

~~further notes~~

~Make other sections like Warning with Warning .... ~

Author(s)

~~who you are~~

References

~put references to the literature/web site here ~

See Also

~~objects to See Also as help, ~~~

Examples

##---- 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
  }

[Package biology version 1.0 Index]