collect_predictors.Rd
Fill risk predictor data with target person data
collect_predictors(tgt = NULL, outcome = "overweight-4y", purpose = "tab10")
Target person data, according to JAMES internal format from bdsreader
.
If tgt = NULL
(default) the function returns an empty data with all values
set to missings.
Character. Currently only "overweight-4y"
Character. Purpose for the predictor data, can be "model"
or "tab10"
.
A tibble with 1 row containing person data
library(bdsreader)
#>
#> Attaching package: ‘bdsreader’
#> The following object is masked from ‘package:bdsmodels’:
#>
#> table34
fn <- system.file("examples/test.json", package = "bdsreader")
fn <-system.file("extdata/bds_v2.0/smocc/Anne_S.json", package = "jamesdemodata")
m <- bdsreader::read_bds(fn, append_ddi = TRUE)
#> Cannot read 'txt': /home/runner/work/_temp/Library/jamesdemodata/extdata/bds_v2.0/smocc/Anne_S.json
tgt <- m
x <- collect_predictors(m)
#> Error in case_match(p$eduf, c(1, 2) ~ "Geen, Basis", 3 ~ "VMBO-P", c(4, 5) ~ "VMBO-T, MAVO", 6 ~ "MBO", 7 ~ "HAVO, VWO", 8 ~ "HBO", 9 ~ "WO, MASTER", .default = "Onbekend"): Can't convert `..1 (left)` <double> to <character>.