Skip to contents

Load a cross-sectional antibody survey data set

Usage

load_pop_data(file_path, ...)

Arguments

file_path

path to an RDS file containing a cross-sectional antibody survey data set, stored as a data.frame() or tibble::tbl_df

...

Arguments passed on to as_pop_data

data

a data.frame() or tibble::tbl_df

antigen_isos

character() vector of antigen isotypes to be used in analyses

age

a character() identifying the age column

id

a character() identifying the id column

value

a character() identifying the value column

standardize

a logical() to determine standardization of columns

Value

a pop_data object (a tibble::tbl_df with extra attributes)

Examples

xs_data <- load_pop_data("https://osf.io/download//n6cp3/")

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