Usage
covwt(x, wt, na.rm = FALSE)
varwt(x, wt, na.rm = FALSE)
scalewt(df, wt = rep(1/nrow(df), nrow(df)), center = TRUE, scale = TRUE)
meanfacwt(df, fac = NULL, wt = rep(1/nrow(df), nrow(df)), drop = FALSE)
varfacwt(df, fac = NULL, wt = rep(1/nrow(df), nrow(df)), drop = FALSE)
covfacwt(df, fac = NULL, wt = rep(1/nrow(df), nrow(df)), drop = FALSE)
scalefacwt(df, fac = NULL, wt = rep(1/nrow(df), nrow(df)), scale = TRUE, drop = FALSE)
Arguments
x
a numeric vector (varwt
) or a matrix (covwt
)
containg the data.
na.rm
a logical value indicating whether NA values should be stripped before the computation proceeds.
df
a dataframe containing the data.
fac
a factor partitioning the data.
wt
a numeric vector of weights.
drop
a logical value indicating whether unused levels should be kept.
scale
a logical value indicating whether data should be scaled or not.
center
a logical value indicating whether data should be centered or not.