reduce.numdfr: Create less memory-heavy version of an 'numdfr' object,...

Description Usage Arguments Value Note Author(s) Examples

Description

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.

Usage

 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, ...)

Arguments

object

object that you want to memory-reduce.

orgdfr

numdfr for which object is an extension.

repsperrow

object like the return value of findRepsPerRow. If not provided, it is calculated.

keeponlyusedrows

if TRUE (default FALSE), the rows from orgdfr that aren't extended by object are dropped from the object.

...

ignored

Value

For reduce and as.numdfr.rep, an object of class "numdfr.rep". For the others, a numdfr object.

Note

Contrary to what the docs of reduce say, this method keeps all the information in the original object!

Author(s)

Nick sabbe

Examples

 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)

NumDfr documentation built on May 2, 2019, 5:50 p.m.