Ero sivun ”Käyttäjä:Paanpe/Testisivu” versioiden välillä
Siirry navigaatioon
Siirry hakuun
(Ak: Uusi sivu: Pekan testailua) |
Ei muokkausyhteenvetoa |
||
Rivi 1: | Rivi 1: | ||
Pekan testailua | Pekan testailua | ||
---- | |||
<rcode | |||
label="Nappi" | |||
> | |||
library(OpasnetUtils) | |||
library(xtable) | |||
dependencies <- data.frame( | |||
Name = c("exposure"), | |||
Key = c("muRtYjhkphoNPQJI") | |||
) | |||
formula <- function(dependencies, ...) { | |||
ComputeDependencies(dependencies, ...) | |||
erf <- 1.5 # RR per ug / m3 | |||
background <- 100 / 100000 # cases per 100000 person-years | |||
population <- 50000 | |||
cases <- exposure * population * background * (erf - 1) | |||
return(cases) | |||
} | |||
data <- tidy(op_baseGetData("opasnet_base", "Op_en5675"), "health.impact") | |||
health.impact <- new("ovariable", | |||
name = "health.impact", | |||
formula = formula, | |||
dependencies = dependencies, | |||
data = data | |||
) | |||
out <- EvalOutput(health.impact, N = 10) | |||
print(xtable(out@output), type = "html") | |||
objects.put(health.impact) | |||
</rcode> | |||
---- | |||
---- |