marginals3d: marginals3d

Description Usage Arguments Value Author(s) See Also Examples

Description

integrate over all others but 3 columns

Usage

1
2
marginals3d(x, vars = c(2, 3, 4), intCol = 1, n = round(nrow(x)^(1/3)/12), 
    dimnames = .colNames(x, vars), fAgg = mean, ...)

Arguments

x

numeric matrix

vars

index (integer or string): column to define integration boxes

intCol

index (integer or string): column to average

n

numeric vector: number of groups per variable

dimnames

dimension names of the result array

fAgg

function applied over the subsets of x[,intCol]

...

further arguments to fAgg

Value

numeric array with each item representing application of fAgg to x[,intCol] and dimnames equal to means of the classes

Author(s)

Thomas Wutzler

See Also

marginals1d twDEMCBlockInt

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
.tmp.f <- function(){
	res <- marginals3d(sample,vars=c("kY","kO","tLagLeaf"),n=8)
	#library(Rcmdr)
	ds <- melt(res)
	scatter3d(ds$kY, ds$tLagLeaf, ds$kO
		, surface=FALSE
		,bg="white", axis.scales=TRUE, grid=TRUE, ellipsoid=FALSE
		, xlab="kY",ylab="tLagLeaf", zlab="kO"
		, point.col=rev(heat.colors(100))[round(rescale(ds$value,to=c(1,100)))]
		,sphere.size=1.5
	)
}

twDEMC documentation built on May 2, 2019, 5:38 p.m.