View source: R/checkInputData.R
checkInputData | R Documentation |
Checks the content and consistency of a candidate data set for calculating the Nature Index.
checkInputData(
inputData = NULL,
indicators = NULL,
referenceValues = NULL,
indicatorObservations = NULL,
ICunits = NULL,
BSunits = NULL,
ecosystems = NULL,
NIunits = NULL
)
inputData |
list with elements named
where the second and third elements are lists, while the others are data.frames.
The last two element, | ||||||||||||||
indicators |
data.frame containing indicator characteristics. | ||||||||||||||
referenceValues |
list containing reference value characteristics. | ||||||||||||||
indicatorObservations |
list containing indicator observations characteristics. | ||||||||||||||
ICunits |
data.frame containing ICunits characteristics. | ||||||||||||||
BSunits |
data.frame containing BSunits characteristics. | ||||||||||||||
ecosystems |
data.frame containing ecosystems characteristics. | ||||||||||||||
NIunits |
data.frame containing NIunits characteristics. |
checkInputData
runs through an extensive series of tests checking
whether the entered dataset contains all the necessary data objects and
variables for calculating the Nature Index, and whether the data contain
consistent information.
The function checks
that all necessary types of data objects are included:
indicators,
reference values,
indicator observations,
ICunits,
BSunits,
ecosystems (not required),
NIunits (not required)
that all required variables characterizing each object type are included.
that IDs and/or names are unique for all types of objects.
consistency among input objects of different types.
for missing values.
While running through the tests, checkInputData
generates error
messages or warnings when identifying missing or inconsistent information.
The function may make some simple modifications to the data set to mend
shortcomings. It issues warning messages explaining such modifications.
The data set to be checked may be entered either as a list assigned to the
argument inputData
and containing all types of objects, or as several
objects, one for each type, assigned to the other function arguments.
either a list with the same elements that was
assigned to function arguments,
or
a set of error messages.
Bård Pedersen
assembleNiObject
and niInput
for more
about the requirements to input data,
importDatasetApi
, getNIdata
, and
niDataImport
for importing data from the NI database.
## Not run:
carnivoreImport <- importDatasetApi(
username = "...",
password = "...",
eco = NULL,
indic = c("Jerv","Gaupe","Ulv"),
year = c("1990","2000","2010","2014","2019"))
checkInputData(inputData = carnivoreImport)
checkInputData(BSunits = 1)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.