DataFrame-utils: Common operations on DataFrame objects

Description Splitting Author(s) See Also Examples

Description

Common operations on DataFrame objects.

Splitting

In the following code snippets, x is a DataFrame.

split(x, f, drop = FALSE): Splits x into a CompressedSplitDataFrameList, according to f, dropping elements corresponding to unrepresented levels if drop is TRUE.

mstack(..., .index.var = "name"): Stacks the data frames passed as through ..., using .index.var as the index column name. See stack.

Author(s)

Michael Lawrence

See Also

DataTable, Vector, and RangedData, which makes heavy use of this class.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
## split

sw <- DataFrame(swiss)
swsplit <- split(sw, sw[["Education"]])
  
## rbind

do.call(rbind, as.list(swsplit))

## cbind

cbind(DataFrame(score), DataFrame(counts))


Search within the IRanges package
Search all R packages, documentation and source code

Questions? Problems? Suggestions? or email at ian@mutexlabs.com.

Please suggest features or report bugs with the GitHub issue tracker.

All documentation is copyright its authors; we didn't write any of that.