make.X: Forms matrix of components

Description Usage Arguments Value Examples

View source: R/make.X.R

Description

This function returns a matrix of component variables, X. The user can specify the desired chemicals and order by creating a list of string vectors, each vector containing the variable names of all desired elements of that group.

Usage

1
make.X(df, num.groups, groups)

Arguments

df

A dataframe containing named component variables

num.groups

An integer representing the number of component groups desired

groups

A list, each item in the list being a string vector of variable names for one component group

Value

A matrix of component variables

Examples

1
2
3
4
data("WQSdata")
group_list <- list(c("X1", "X2", "X3"), c("X4", "X7"), c("X5", "X6", "X9", "X8"))
X <- make.X(WQSdata, 3, group_list)
X

groupWQS documentation built on July 1, 2020, 10:29 p.m.