View source: R/validate_data.R
validate_data | R Documentation |
The 2012 data of the federal database contains tract 18063, corner 2.
There are boundaries recorded for that corner, nevertheless tree 14 has no
azimuth measurement. This function therefore checks for the data sets not
having missing
data in the columns needed by get_correction_factors
and
optionally removes affected observations.
It does not cross check whether missing data is really needed (azimuth is
not when there is no boundary recorded for that tracts corner).
validate_data(x, type = c(NA, "angle_counts", "boundaries"), clean = FALSE)
x |
A tree or angle count data set. |
type |
The type of data, stick with the default to let us guess. |
clean |
Omit missing data? If the input contains missing data in the
columns needed by |
A tree data set. The input, if that was valid data, the cleaned input otherwise. Throws an error if columns are missing.
boundaries <- get(data("boundaries", package = "treePlotArea"))
nrow(boundaries)
nrow(validate_data(x = boundaries))
boundaries[1, "enr"] <- NA
try(validate_data(boundaries))
nrow(validate_data(boundaries, clean = TRUE))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.