Utility to convert objects of S3 class prcomp
(Q-mode PCA) to
objects of S3 class princomp
(R-mode PCA) or vice-versa. An
internal function, not generally called by the user.
q2rPCA(x)
An object of either class prcomp
or class
princomp
. It will be converted to a form that can be used by
functions expecting either class.
A list of class conPCA
. Note that the order of the
elements will vary depending upon the direction of conversion.
The loadings from princomp
, or a copy of the
rotations from prcomp
.
The scores from
princomp
, or a copy of the x values from prcomp
.
The call. Objects of class prcomp
do not store the
original call, so a place holder is used. Otherwise the unchanged call from
princomp
.
The number of observations from
princomp
, or computed from the 1st dimension of x in
prcomp
.
conPCA
is pre-pended to the
existing class.
Unchanged from original.
Unchanged from original.
Unchanged from original.
In the conversion, the necessary list elements are added; the old elements
are not deleted (and user added list elements are not affected). To
indicate this, the class attribute is updated to include class
conPCA
. The new object can then be used by functions expecting
either class prcomp or princomp. For details of the structure of
prcomp
or princomp
, see their respective help
pages.