Description Usage Arguments Value Note Author(s) Examples
When a numdfr
is really a set of repeated rows from another one, this
function can be used to make a new object (of class "numdfr.rep") that holds the same
information in more condensed format. Disadvantage is that the data is less
easily manipulated.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | ## S3 method for class 'numdfr'
reduce(object, orgdfr, repsperrow=NULL, keeponlyusedrows=FALSE, ...)
## S3 method for class 'numdfr.rep'
unreduce(object, ...)
## S3 method for class 'data.frame'
as.numdfr(object, ...)
## S3 method for class 'data.frame.rep'
as.numdfr(object, ...)
## S3 method for class 'numdfr'
as.numdfr(object, ...)
## S3 method for class 'numdfr.rep'
as.numdfr(object, ...)
## S3 method for class 'numdfr'
as.numdfr.rep(object, orgdfr, ...)
|
object |
object that you want to memory-reduce. |
orgdfr |
|
repsperrow |
object like the return value of |
keeponlyusedrows |
if |
... |
ignored |
For reduce
and as.numdfr.rep
, an object of class "numdfr.rep". For
the others, a numdfr
object.
Contrary to what the docs of reduce
say, this method keeps all
the information in the original object!
Nick sabbe
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | iris.cpy<-as.numdfr(randomNA(iris, n=0.1))
rownames(iris.cpy)<-paste(seq(nrow(iris.cpy)), "_", sep="")
takesomerows<-sort(sample(nrow(iris.cpy), 50, replace=TRUE))
iris.ex<-randomFillDS(iris.cpy[takesomerows,])
str(iris.ex)
iris.red<-reduce(iris.ex, iris.cpy)
str(iris.red)
iris.back<-unreduce(iris.red)
str(iris.back)
iris.red2<-reduce(iris.ex, iris.cpy, keeponlyusedrows=TRUE)
object.size(iris.ex)
object.size(iris.red)
object.size(iris.red2)
str(iris.red2)
iris.back2<-unreduce(iris.red2)
str(iris.back2)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.