ck.f: Check data for a full factorial

View source: R/ck_f.R

ck.fR Documentation

Check data for a full factorial

Description

This function checks the frequencies for a full factorial.

Usage

ck.f(trait, factors, rep, dfr)

Arguments

trait

The name of the column for the trait to analyze.

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 treatments without data (nt.0), the number of treatments that appear more than once in a given replication (nt.mult), the number of missing values nmis, the proportion of missing values (pmis), the number of factors (nf), the number of levels of each factor (nl), the number of replications (nrep), a table with frequencies of valid cases for each combination of the levels of the factors (tf), a table with frequencies of valid cases for each combination of the levels of the factors in each replication (tfr), and the number of rows in the data frame with missing values for factors (nmis.fac).

Author(s)

Raul Eyzaguirre.

Examples

# 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
# Create some random data
dfr$y <- rnorm(45)
# Delete some values
dfr[c(4, 5, 12), 'y'] <- NA
# Check the design
ck.f("y", c("A", "B"), "block", dfr)

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