ck.fs: Check factors structure

View source: R/ck_fs.R

ck.fsR Documentation

Check factors structure

Description

This function cheks the structure of factors.

Usage

ck.fs(factors, rep, dfr)

Arguments

factors

The names of the columns that identify the factors.

rep

The name of the column that identifies the replications, NULL for a CRD.

dfr

The name of the data frame.

Value

The number of factors (nf), the number of levels of the factors (nl), the lists of levels of factors (lf), the number of treatments (nt), the list of treatments (lt), the number of replications (nrep), the list of replications (lrep), the number of rows with missing values for factors (nmis.fac), and the data frame after removal of all these rows.

Author(s)

Raul Eyzaguirre.

Examples

## Example 1
# Create a design
dfr <- cr.rcbd(1:20, 3, 10)
dfr <- dfr$book
# Check the design
ck.fs("geno", "block", dfr)

## Example 2
# Create a design
A <- paste0("a", 1:5)
B <- paste0("b", 1:3)
dfr <- cr.f(c("A", "B"), list(A, B), "rcbd", 3, 10)
dfr <- dfr$book
# Check the design
ck.fs(c("A", "B"), "block", dfr)

reyzaguirre/st4gi documentation built on April 14, 2024, 11:46 p.m.