Load a cross-sectional antibody survey data set
Usage
as_pop_data(
data,
antigen_isos = NULL,
age = "Age",
value = "result",
id = "index_id",
standardize = TRUE
)
Arguments
- data
- antigen_isos
character()
vector of antigen isotypes to be used in analyses- age
a
character()
identifying the age column- value
a
character()
identifying the value column- id
a
character()
identifying the id column- standardize
a
logical()
to determine standardization of columns
Value
a pop_data
object (a tibble::tbl_df with extra attribute antigen_isos
)
Examples
library(magrittr)
xs_data <-
"https://osf.io/download//n6cp3/" %>%
readr::read_rds() %>%
as_pop_data()
print(xs_data)
#> # A tibble: 3,336 × 8
#> id Country cluster catchment age ageCat antigen_iso value
#> <chr> <chr> <fct> <chr> <dbl> <fct> <fct> <dbl>
#> 1 B1 Bangladesh Ward 2 N dhaka 4 <5 HlyE_IgA 7.24
#> 2 B2 Bangladesh Ward 2 N dhaka 4 <5 HlyE_IgG 24.0
#> 3 B3 Bangladesh Ward 2 N dhaka 3.7 <5 HlyE_IgA 0.836
#> 4 B4 Bangladesh Ward 2 N dhaka 3.7 <5 HlyE_IgG 3.17
#> 5 B5 Bangladesh Ward 2 N dhaka 10.6 5-15 HlyE_IgA 3.42
#> 6 B6 Bangladesh Ward 2 N dhaka 10.6 5-15 HlyE_IgG 14.3
#> 7 B7 Bangladesh Ward 2 N dhaka 16 16+ HlyE_IgA 8.84
#> 8 B8 Bangladesh Ward 2 N dhaka 16 16+ HlyE_IgG 14.2
#> 9 B9 Bangladesh Ward 2 N dhaka 16.5 16+ HlyE_IgA 10.3
#> 10 B10 Bangladesh Ward 2 N dhaka 16.5 16+ HlyE_IgG 29.4
#> # ℹ 3,326 more rows