getOccasionElements
[Simulx] Get occasion elements
Get the content of the occasion element that will be used for the simulation. The element will be automatically used for simulation and does not need to be added to a simulation group.
Usage
getOccasionElements()
Details
The occasion element can be defined with defineOccasionElement, or created during the import of a Monolix or PKanalix project with
.importProject
. It can be deleted with deleteOccasionElement
The element is a list of
"id" | (character) | Ids of the occasions |
"names" | (character) | Name of the occasions. If empty, no occasions will be used in the project. |
"times" | (data.frame) | Times of the occasions. |
"occasions" | (data.frame) | Values of the element. If empty, no occasions will be used in the project. |
The structure of the occasion elements impacts the definition of all other elements in the Simulx project. If the occasion element is subject-specific, other elements (parameters, covariates, treatments, outputs and regressors) must be either common over all subjects and all occasions, or they must be defined with subject-specific occasion-wise values as an external table (with id and occ columns), with the same occasion structure.
See also
Examples
# Get occasion elements in projects in which they were defined differently
initializeLixoftConnectors("simulx")
project_name <- file.path(getDemoPath(), "3.definition", "3.7.occasions", "occasions_common.smlx")
loadProject(project_name)
getOccasionElements()
#> $names
#> [1] "occ"
#>
#> $time
#> [1] 0 0
#>
#> $occasions
#> $occasions[[1]]
#> [1] 1
#>
#> $occasions[[2]]
#> [1] 2
#>
#>
project_name <- file.path(getDemoPath(), "3.definition", "3.7.occasions", "occasions_common_washout.smlx")
loadProject(project_name)
getOccasionElements()
#> $names
#> [1] "occ"
#>
#> $time
#> [1] 0 50
#>
#> $occasions
#> $occasions[[1]]
#> [1] 1
#>
#> $occasions[[2]]
#> [1] 2
#>
#>
project_name <- file.path(getDemoPath(), "3.definition", "3.7.occasions", "occasions_external.smlx")
loadProject(project_name)
getOccasionElements()
#> $file
#> $file$filename
#> [1] "C:/Users/FranoMihaljevic/lixoft/simulx/simulx2024R1/demos/3.definition/3.7.occasions/occasions_external/ExternalFiles/occtable.csv"
#>
#>
#> $id
#> [1] "1" "1" "1" "2" "2" "3" "3" "4" "4" "4" "4" "5" "5" "6" "6"
#> [16] "6" "7" "7" "8" "8" "8" "8" "9" "9" "10" "10" "10"
#>
#> $names
#> [1] "OCC"
#>
#> $time
#> [1] 0 24 48 0 48 0 24 0 24 48 72 0 24 0 48 72 24 72 0 24 48 72 0 48 24
#> [26] 48 72
#>
#> $occasions
#> $occasions[[1]]
#> [1] 1
#>
#> $occasions[[2]]
#> [1] 2
#>
#> $occasions[[3]]
#> [1] 3
#>
#> $occasions[[4]]
#> [1] 1
#>
#> $occasions[[5]]
#> [1] 2
#>
#> $occasions[[6]]
#> [1] 1
#>
#> $occasions[[7]]
#> [1] 2
#>
#> $occasions[[8]]
#> [1] 1
#>
#> $occasions[[9]]
#> [1] 2
#>
#> $occasions[[10]]
#> [1] 3
#>
#> $occasions[[11]]
#> [1] 4
#>
#> $occasions[[12]]
#> [1] 1
#>
#> $occasions[[13]]
#> [1] 2
#>
#> $occasions[[14]]
#> [1] 1
#>
#> $occasions[[15]]
#> [1] 2
#>
#> $occasions[[16]]
#> [1] 3
#>
#> $occasions[[17]]
#> [1] 1
#>
#> $occasions[[18]]
#> [1] 2
#>
#> $occasions[[19]]
#> [1] 1
#>
#> $occasions[[20]]
#> [1] 2
#>
#> $occasions[[21]]
#> [1] 3
#>
#> $occasions[[22]]
#> [1] 4
#>
#> $occasions[[23]]
#> [1] 1
#>
#> $occasions[[24]]
#> [1] 2
#>
#> $occasions[[25]]
#> [1] 2
#>
#> $occasions[[26]]
#> [1] 3
#>
#> $occasions[[27]]
#> [1] 4
#>
#>
project_name <- file.path(getDemoPath(), "3.definition", "3.7.occasions", "occasions_two_levels.smlx")
loadProject(project_name)
getOccasionElements()
#> $names
#> [1] "occ1" "occ2"
#>
#> $time
#> [1] 0 24 0 24
#>
#> $occasions
#> $occasions[[1]]
#> [1] 1 1
#>
#> $occasions[[2]]
#> [1] 1 2
#>
#> $occasions[[3]]
#> [1] 2 1
#>
#> $occasions[[4]]
#> [1] 2 2
#>
#>