getNIdata | R Documentation |
Functions that reads data from tables in the NI database via [The Nature Index Application Programming Interface](https://www8.nina.no/NaturindeksNiCalc/index.html) and imports the content as a data.frame.
getBSunits(BSunitIds = NULL)
getEcosystems()
getEcosystemBSunitData()
getFunctionalGroupData()
getICunits(indicatorIds = NULL)
getICunitBSunit(icunits = NULL)
getIndicators2(indicatorIds = NULL)
getIndicatorEcosystemData(ecosystemIds = NULL, indicatorIds = NULL)
getIndicatorValues2(indicatorIds = NULL, refYear = NULL)
getRefYearData()
getScalingModelData()
BSunitIds |
integer, optional.
|
indicatorIds |
integer, optional. |
icunits |
integer, optional.
|
ecosystemIds |
integer, optional.
|
refYear |
character, optional.
|
Each function reads one table in the database:
Function | Table in NI database | Content | Column names in returned dataframe |
getBSunits | Kommune
| Characteristics for all BSunits. | [,1] "id" , |
[,2] "name" , |
|||
[,3] "area" , |
|||
[,4] "terrestrial" , |
|||
[,5] "marine" , |
|||
[,6] "county" , |
|||
[,7] "part" , |
|||
[,8] "centerLat" , |
|||
[,9] "centerLong" |
|||
getEcosystems | T_Okosystem
| Ecosystem names and ids. | [,1] "id" , |
[,2] "name" , |
|||
[,3] "nameEnglish" . |
|||
getEcosystemBSunitData | Kommune_Okosystem
| Area of major ecosystems | [,1] "ecosystemId" , |
per BSunit | [,2] "municipalityId" , |
||
[,3] "area" . |
|||
getFunctionalGroupData | T_FunksjonellGruppe
| names of functional groups | [,1] "id" , |
[,2] "name" , |
|||
[,3] "nameEnglish" . |
|||
getICunits | Omraade | ICunit for each indicator | [,1] "id" , |
[,2] "name" , |
|||
[,3] "indicatorId" . |
|||
getICunitBSunit | Omraade_Kommune | BSunits within each ICunit. | [,1] "areaId" , |
[,2] "municipalityId" . |
|||
getIndicators2 | Indikator | Characteristics for all indicators | [, 1] "id" , |
[, 2] "active" , |
|||
[, 3] "name" , |
|||
[, 4] "nameEnglish" , |
|||
[, 5] "nameLatin" , |
|||
[, 6] "indicatorTypeId" , |
|||
[, 7] "taxaDetailId" , |
|||
[, 8] "functionalGroupId" , |
|||
[, 9] "scalingModel" , |
|||
[,10] "taxaKingdomId" , |
|||
[,11] "keyElement" , |
|||
[,12] "referenceStateId" . |
|||
getIndicatorEcosystemData | Indikator_Okosystem
| Fidelity of indicators | [,1] "indicatorId" , |
per major ecosystem | [,2] "ecosystemId" , |
||
[,3] "percent" . |
|||
getIndicatorValues2 | Verdier
| Reference values and | [, 1] "indicatorId" , |
indicator observations | [, 2] "indicatorName" , |
||
[, 3] "areaId" , |
|||
[, 4] "areaName" , |
|||
[, 5] "yearId" , |
|||
[, 6] "yearName" , |
|||
[, 7] "verdi" , |
|||
[, 8] "nedre_Kvartil" , |
|||
[, 9] "ovre_Kvartil" , |
|||
[,10] "datatypeId" , |
|||
[,11] "datatypeName" , |
|||
[,12] "unitOfMeasurement" , |
|||
[,13] "customDistributionUUID" , |
|||
[,14] "distributionName" , |
|||
[,15] "distributionId" , |
|||
[,16] "distParam1" , |
|||
[,17] "distParam2" . |
|||
getRefYearData | T_RefAar
| Ids for observation years and | [,1] "id" , |
the reference value category | [,2] "name" , |
||
[,3] "nameEnglish" . |
|||
getScalingModelData | T_Skaleringsmodell
| names of scaling models | [,1] "id" , |
[,2] "name" .
|
All functions except getIndicatorValues2
returns a data frame
with content according to the above table, or an error message if extraction of data
from the database fails.
getIndicatorValues2
returns a list of two elements:
1) a data frame indicatorValues
of indicator observations content
according to the above table, and
2) a list customDistributions
of optional distribution objects associated
with some of the observations. Distribution objects are identified through
the variable indicatorValues$customDistributionUUID
Column names of returned objects are generated by the API and differ somewhat from the column headings in the corresponding table in the NI database.
Bård Pedersen
getToken
for retrieving tokens from the Nature Index API,
extractContentFromNiapi
, a general purpose utility function called
by the functions described here that retrieves data from the specified tables
in the Nature Index database, and importDatasetApi
for importing
from the database all required data for calculating the Nature Index for an
ecosystem.
## Not run:
getBSunits()
getEcosystems()
getEcosystemBSunitData()
getFunctionalGroupData()
getICunits()
getICunitBSunit()
getIndicators2()
getIndicatorEcosystemData()
getIndicatorValues2(indicatorIds = 1:2,refYear = c("2010","Referanseverdi"))
getRefYearData()
getScalingModelData()
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.