setzero.pt: Set values to '0' for potato data.

View source: R/setzero_pt.R

setzero.ptR Documentation

Set values to 0 for potato data.

Description

Set values to 0 for harvested traits.

Usage

setzero.pt(dfr)

Arguments

dfr

The name of the data frame.

Details

This function sets values to 0 for all traits at harvest (nph, nmtp, nnomtp, mtwp, and nomtwp) which are NA according to the following rules:

  • If nph == 0, then all traits are set to 0.

  • If nmtp == 0, then mtwp is set to 0.

  • If mtwp == 0, then nmtp is set to 0.

  • If nnomtp == 0, then nomtwp is set to 0.

  • If nomtwp == 0, then nnomtp is set to 0.

Value

It returns a data frame and a list of warnings with all the rows that have been modified.

Author(s)

Raul Eyzaguirre

Examples

dfr <- data.frame(nph = c(NA,  0,  3,  3,  3, 3, 3),
                  mtwp  = c(NA, NA, NA, NA,  8, 2, 0),
                  nomtwp = c(NA, NA, NA,  2, NA, 2, 4),
                  nmtp = c(NA, NA, NA,  0,  6, 2, 0),
                  nnomtp = c(NA, NA, NA,  4,  0, 3, 5))
setzero.pt(dfr)

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