inst/unitTests/test_DataFrame-utils.R

## splitting
test_DataFrame_splitting <- function() {
  data(swiss)
  rn <- rownames(swiss)
  sw <- DataFrame(swiss, row.names=rn)
  swisssplit <- split(swiss, swiss$Education)

  ## split
  swsplit <- split(sw, sw[["Education"]])
  checkTrue(validObject(swsplit))
  checkIdentical(as.list(lapply(swsplit, as.data.frame)), swisssplit)
  checkTrue(validObject(split(DataFrame(IRanges(1:26, 1:26), LETTERS),
                              letters)))
}

Try the IRanges package in your browser

Any scripts or data that you put into this service are public.

IRanges documentation built on Dec. 14, 2020, 2 a.m.