ck.fq: Check frequencies

View source: R/ck_fq.R

ck.fqR Documentation

Check frequencies

Description

This function cheks the frequencies of valid cases for treatments and replications.

Usage

ck.fq(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

A table of frequencies of valid cases for all factors' levels combinations (tf), a table of frequencies of valid cases for all factors' levels and replications combinations (tfr), the number of missing values nmis, and the proportion of missing values (pmis).

Author(s)

Raul Eyzaguirre.

Examples

## Example 1
# Create a design
dfr <- cr.rcbd(1:20, 3, 10)
dfr <- dfr$book
# Create some random data
dfr$y <- rnorm(60)
# Delete some values
dfr[c(1, 5, 16, 17), 'y'] <- NA
# Check the frequencies
ck.fq("y", "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
# Create some random data
dfr$y <- rnorm(45)
# Delete some values
dfr[c(5, 10, 24), 'y'] <- NA
# Check the frequencies
ck.fq("y", c("A", "B"), "block", dfr)

reyzaguirre/st4gi documentation built on April 30, 2024, 5:45 a.m.