Description Usage Arguments Details Value Author(s) References See Also Examples
These function handle ABMI specific Na values.
1 2 3 4 5 6 7 8 | abmi.is.na(x,
na.char = c("NA", "VNA", "DNC", "PNA", "SNI"))
abmi.convert.na(x, value = NA,
na.char = c("NA", "VNA", "DNC", "PNA", "SNI"))
abmi.na.omit(x, value = NA,
na.char = c("NA", "VNA", "DNC", "PNA", "SNI"))
abmi.na.exclude(x, value = NA,
na.char = c("NA", "VNA", "DNC", "PNA", "SNI"))
|
x |
an object (vector, matrix or data frame). |
na.char |
character vector defining strings treated as NA. |
value |
value to return instead of |
ABMI has different types of NA values with different meaning:
VNA
: Variable Not Applicable.
Some ABMI data is collected in a nested manner. For example Tree Species is a parent variable. This
variable has a number of child variables that are used to describe the parent variable in more detail
(e.g., condition, DBH, decay stage). When the parent variable is recorded as “None,” child variables
are no longer applied and are recorded as “VNA.” VNA is also used when the protocol calls for a
modified sampling procedure based on site conditions (e.g., surface substrate protocol variant for
hydric site conditions). The use of VNA implies that users of the data should not expect that any
data could be present.
DNC
: Did Not Collect.
DNC is used to describe variables that should have been collected but were not. There are a
number of reasons that data might not have been collected (e.g. staff oversight, equipment failure,
safety concerns, environmental conditions, or time constraints). Regardless of the reason data was not
collected, if under ideal conditions it should have been, the record in the data entry file reads DNC.
The use of DNC implies that users should expect the data to be present – though it is not.
PNA
: Protocol Not Available.
The ABMI's protocols were, and continue to be, implemented in a staged manner. As a result, the
collection of many variables began in years subsequent to the start of the prototype or operational
phases or where discontinued after a few years of trial. When a variable was not collected because the
protocol had yet to be implemented by the ABMI (or was discontinued by the ABMI), the data entry
record reads PNA. This is a global constraint to the data (i.e. a protocol was not implemented until
2006, therefore, previous years cannot have this variable). PNA is to be used to describe the lack of
data collection for entire years.
SNI
: Species Not Identified.
In various fields related to species identification, SNI is used to indicate that the organism was not
identified to the species level. Some possible reasons that identification to the species level of
resolution was not possible include, insufficient or deficient sample collected and lack of field time.
The function abmi.is.na
is similar of the primitive function is.na
, evaluates if elements of
the input object are one of the cases of ABMI NA types.
abmi.convert.na
convert ABMI NA types into NA values that can be identified by the is.na
function.
It is advisable to use abmi.convert.na
before using raw data to build e.g. lists.
abmi.na.omit
and abmi.na.exclude
work similarly to na.omit
and na.exclude
generic functions,
both remove NA cases (rows). Follow the links to see the differences.
abmi.is.na
returns an object with same class and dimension as the original, but containing logical values.
TRUE for those elements marked NA and FALSE otherwise. dim
, dimnames
and names
attributes are preserved.
Currently it does not support list objects.
abmi.convert.na
returns the original object with some elements turned into NA.
abmi.na.omit
and abmi.na.exclude
returns the original objects with cases/rows corresponding to NA values deleted.
Deleted cases are registered into the "na.action"
attribute.
P\'eter S\'olymos, solymos@ualberta.ca
1 2 3 4 5 6 7 8 9 | data(abmi.data)
abmi.is.na(abmi.data$sitecap[1:100,9])
abmi.is.na(abmi.data$sitecap[101:120,9:10])
abmi.convert.na(abmi.data$sitecap[1:100,9])
abmi.convert.na(abmi.data$sitecap[101:120,9:10])
abmi.na.omit(abmi.data$sitecap[1:100,9])
abmi.na.omit(abmi.data$sitecap[101:120,9:10])
abmi.na.exclude(abmi.data$sitecap[1:100,9])
abmi.na.exclude(abmi.data$sitecap[101:120,9:10])
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.