setzero.pt | R Documentation |
0
for potato data.Set values to 0
for harvested traits.
setzero.pt(dfr)
dfr |
The name of the data frame. |
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
.
It returns a data frame and a list of warnings with all the rows that have been modified.
Raul Eyzaguirre
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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.