l_scale3D scales its argument in a variety of ways used for 3D visualization.

l_scale3D(x, center = TRUE, method = c("box", "sphere"))

Arguments

x

the matrix or data.frame whose columns are to be scaled.

center

either a logical value or numeric-alike vector of length equal to the number of columns of x, where ‘numeric-alike’ means that as.numeric(.) will be applied successfully if is.numeric(.) is not true.

method

the scaling method to use: if "box" (the default) then the columns are scaled to have equal ranges; if "sphere" then x is centered, scaled to equal standard deviation and then decomposed via a singular value decomposition so that the resulting variables are uncorrelated.

Value

a data.frame whose columns are centred and scaled according to the given arguments.

See also

l_plot3D scale

Other three-dimensional plotting functions: l_plot3D.default, l_plot3D

Examples

##### Iris with(l_scale3D(iris[,1:4]), l_plot3D(Petal.Length, Petal.Width, Sepal.Length, linkingGroup = "iris"))
#> [1] ".l115.plot3D" #> attr(,"class") #> [1] "l_plot3D" "l_plot" "loon"
with(l_scale3D(iris[,1:4], method = "sphere"), l_plot3D(pc1, pc2, pc3, linkingGroup = "iris"))
#> [1] ".l116.plot3D" #> attr(,"class") #> [1] "l_plot3D" "l_plot" "loon"
# With the Species as a factor with(l_scale3D(iris), l_plot3D(Petal.Length, Petal.Width, Sepal.Length, linkingGroup = "iris"))
#> [1] ".l117.plot3D" #> attr(,"class") #> [1] "l_plot3D" "l_plot" "loon"
with(l_scale3D(iris, method = "sphere"), l_plot3D(pc1, pc2, pc3, linkingGroup = "iris"))
#> [1] ".l118.plot3D" #> attr(,"class") #> [1] "l_plot3D" "l_plot" "loon"