tests/subset.R

 library(aster2)

 data(echinacea)

 foo <- echinacea$redata$pop
 bar <- match(levels(foo), as.character(foo))
 baz <- echinacea$redata$id %in% echinacea$redata$id[bar]

 out <- subset(echinacea, baz)

 all(sort(unique(out$redata$id)) == sort(bar))

 opred <- echinacea$repred[baz]
 ipred <- seq(along = echinacea$repred)[baz]
 all(c(0, ipred)[1 + out$repred] == opred)

 opred <- echinacea$regroup[baz]
 all(c(0, ipred)[1 + out$regroup] == opred)

Try the aster2 package in your browser

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

aster2 documentation built on May 30, 2017, 2:12 a.m.