Uses stats::prcomp()
to compute the Principal Component Analysis of a time series and return the principal components instead of the original columns. Output columns are named "PC1", "PC2" and so on.
See also
Other tsl_transformation:
f_binary()
,
f_chi_squared()
,
f_clr()
,
f_detrend_difference()
,
f_detrend_linear()
,
f_hellinger()
,
f_list()
,
f_log()
,
f_percentage()
,
f_proportion()
,
f_proportion_sqrt()
,
f_rescale_global()
,
f_rescale_local()
,
f_scale_global()
,
f_scale_local()
,
f_slope()
,
f_trend_linear()
Examples
x <- zoo_simulate(cols = 2)
y <- f_pca(
x = x
)
if(interactive()){
zoo_plot(x)
zoo_plot(y)
}