statistics

Posted by Jeet Sukumaran

There are several functions that calculate principal component statistics in R. Two of these are "prcomp()" and "princomp()". The "prcomp()" function has fewer features, but is numerically more stable than "princomp()".

Both of these functions can be invoked by simply passing in a suitable data frame, in which case all columns will be used:

    pca1 = prcomp(d)
    pca2 = princomp(d)

Alternatively, the columns to be used can be specified using a formula notation:

Posted by Jeet Sukumaran

The following code snippet will return the mode(s) of a list of values, using the specified bin size. If "bin_size" is set to "None", then values are not binned.