project | R Documentation |
Reduces the dimensionality of a data set.
project(x, w)
x |
a data frame |
w |
a matrix with named rows and columns |
Each column of w
specifies a new variable, which is to be
constructed by combining existing variables according to the given weights.
A data frame where the variables named in the rows of w
are
replaced by new variables named in the columns of w
.
Other variables are left unchanged.
Tom Minka
pca
, projection
, plot_axes
data(iris) w = projection(iris, k=2) # w only involves the continuous attributes # the new variables are h1 and h2 x = project(iris, w) # in RStudio use dev.new() color.plot(x) plot_axes(w)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.