Training exposure: Difference between revisions
Jump to navigation
Jump to search
(adjusted) |
(code possibly works) |
||
Line 9: | Line 9: | ||
<t2b index="Year,Observation" locations="Unit,Result,Description" unit="-"> | <t2b index="Year,Observation" locations="Unit,Result,Description" unit="-"> | ||
2012|ug/m3| | 2012|ug/m3|1 - 2| | ||
2020|ug/m3|20| | 2020|ug/m3|20 - 11| | ||
</t2b> | </t2b> | ||
Line 20: | Line 20: | ||
page:Object-oriented_programming_in_Opasnet|name:answer| | page:Object-oriented_programming_in_Opasnet|name:answer| | ||
page:OpasnetBaseUtils|name:generic| | page:OpasnetBaseUtils|name:generic| | ||
page: | page:Training_exposure|name:formula | ||
" | " | ||
> | > | ||
out <- | out <- tidy(op_baseGetData("opasnet_base", "Op_en5674"), direction = "wide") | ||
out <- make.ovariable(out) | |||
cat("Computed training exposures.\n") | cat("Computed training exposures.\n") | ||
print(out) | print(out) | ||
print(formula.Op_en5674(dependencies.Op_en5674)) | |||
cat("Computed training exposures.\n") | |||
</rcode> | </rcode> | ||
Line 43: | Line 46: | ||
> | > | ||
cat("Initiation successful. Now starting the model.\n") | |||
############ tapply of ovariables applies a function to each cell of a ragged array, that is to each (non-empty) group of values given by a unique combination of the levels of certain factors. | |||
### parameters (other parameters are as in generic tapply): | |||
### X an ovariable | |||
setMethod(f = "tapply", | |||
signature = signature(X = "ovariable"), | |||
definition = function(X, INDEX, FUN = NULL, ..., simplify = TRUE) { | |||
out <- as.data.frame(as.table(tapply(X@sample$Result, INDEX, FUN, ..., simplify = TRUE))) | |||
X@sample <- out | |||
return(X) | |||
} | } | ||
) | |||
formula.Op_en5674 <- function(x) { | |||
ueConc <- make.ovariable(x$microenvironment.concentration) | |||
ueTime <- make.ovariable(x$microenvironment.time) | |||
out <- ueConc * ueTime | |||
out <- tapply(out, out@sample[c("Iter", "Unit")], sum) | |||
return(out) | |||
return( | |||
} | } | ||
dependencies.Op_en5674 <- list( | dependencies.Op_en5674 <- list( | ||
microenvironment.concentration = data.frame( | |||
Microenvironment = c("Home", "Other"), | |||
Unit = "ug/m3", | |||
Result = c(1, 2)), | |||
microenvironment.time = data.frame( | |||
Microenvironment = c("Home", "Other"), | |||
Unit = "ug/m3", | |||
Result = c(0.7, 0.3)) | |||
) | ) | ||
Revision as of 04:50, 13 May 2012
Moderator:Jouni (see all) |
This page is a stub. You may improve it into a full page. |
Upload data
|
Question
What is the exposure in the Training assessment?
Answer
Obs | Year | Unit | Result | Description |
---|---|---|---|---|
1 | 2012 | ug/m3 | 1 - 2 | |
2 | 2020 | ug/m3 | 20 - 11 |
Rationale
Formula
See also
Keywords
References
Related files
<mfanonymousfilelist></mfanonymousfilelist>