View source: R/setIndicatorValues.R
setIndicatorValues | R Documentation |
This function fills info into an indicatorData
object which can later be uploaded to the database.
Usually, this object is first retrieved from the database through the function getIndicatorData
.
This object will list all data that a user is privileged to alter for a particular indicator.
Data is accepted either in the form of an estimate together with an lower and upper quartile of uncertainty,
or as a distribution object generated by makeDistribution
.
setIndicatorValues(
indicatorData = NULL,
areaId = NULL,
years = NULL,
est = NA,
lower = NA,
upper = NA,
distribution = NULL,
datatype = NA,
unitOfMeasurement = "Enhetsløs"
)
indicatorData |
Object of class 'indicatorData' created by |
areaId |
Numeric. Identifier of the indicator value to be altered. |
years |
Numeric. Which year to set values for. |
est |
Numeric. Point estimate for the indicator value. Optional. |
lower |
Numeric. Lower quartile of estimate. Required when supplying point estimate. |
upper |
Numeric. Upper quartile of estimate. Required when supplying point estimate. |
distribution |
distribution object generated by |
datatype |
Type of observation. Remember to update this when the type changes. Allowed values: NA, 1 = Ekspertvurdering, 2 = Overvåkingsdata, 3 = Beregnet fra modeller. Defaults to NA. |
unitOfMeasurement |
Text of maximum length 100. Defaults to "Enhetsløs". |
Object of class 'indicatorData'.
Jens Åström
makeDistribution
, and getIndicatorValues
.
The vignette Distributions
gives detailed descriptions of the use of
setIndicatorValues
when revising and updating values for an indicator.
myData <- indicatorData
class(myData)
myData <- setIndicatorValues(myData, areaId = 7040, years = 1950,
est = 0.9, lower = 0.7, upper = 1,
datatype = 1)
myDist <- makeDistribution(input = "logNormal",distParams = list("mean" = 40, "sd" = 2))
myData <- setIndicatorValues(myData, areaId = 7041, years = 1950,
distribution = myDist,
datatype = 2)
myCodasamples <- rnorm(n = 1000, mean = 15)
myData <- setIndicatorValues(myData, areaId = 7042, years = 1950,
distribution = makeDistribution(myCodasamples),
datatype = 3, unitOfMeasurement = "antall/m2")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.