Skip to contents

Pull a survey by survey code or id.

Usage

pull_survey(survey_list, id = NULL, filename = NULL)

Arguments

survey_list

A list of surveys

id

The id of the requested survey. If NULL use filename

filename

The filename of the requested survey.

Value

A single survey identified by id or filename.

See also

Other import functions: read_csv(), read_dta(), read_rds(), read_spss(), read_surveys()

Examples

examples_dir <- system.file( "examples", package = "retroharmonize")

my_rds_files <- dir( examples_dir)[grepl(".rds", 
                                   dir(examples_dir))]

example_surveys <- read_surveys(
    file.path(examples_dir, my_rds_files) )

pull_survey(example_surveys, id = "ZA5913")
#> # A tibble: 35 × 37
#>    rowid     doi    version   uniqid isocntry       p1    p3       p4 nuts      
#>  * <chr>     <chr>  <chr>      <dbl> <chr>    <dbl+lb> <dbl> <dbl+lb> <chr+lbl> 
#>  1 ZA5913_1  doi:1… 2.0.0 (…  1.13e7 NL        8 [Tue…    27 1 [Two … NL21 [Ove…
#>  2 ZA5913_2  doi:1… 2.0.0 (…  1.13e7 NL        8 [Tue…    31 1 [Two … NL33 [Zui…
#>  3 ZA5913_3  doi:1… 2.0.0 (…  1.13e7 NL       10 [Thu…    26 1 [Two … NL32 [Noo…
#>  4 ZA5913_4  doi:1… 2.0.0 (…  1.13e7 NL       14 [Mon…    23 1 [Two … NL22 [Gel…
#>  5 ZA5913_5  doi:1… 2.0.0 (…  1.13e7 NL       10 [Thu…    31 2 [Thre… NL33 [Zui…
#>  6 ZA5913_6  doi:1… 2.0.0 (…  1.13e7 NL        8 [Tue…    33 1 [Two … NL41 [Noo…
#>  7 ZA5913_7  doi:1… 2.0.0 (…  1.13e7 NL       10 [Thu…    21 1 [Two … NL13 [Dre…
#>  8 ZA5913_8  doi:1… 2.0.0 (…  1.13e7 NL       10 [Thu…    44 1 [Two … NL13 [Dre…
#>  9 ZA5913_9  doi:1… 2.0.0 (…  1.13e7 NL        5 [Sat…    19 1 [Two … NL34 [Zee…
#> 10 ZA5913_10 doi:1… 2.0.0 (…  1.13e7 NL       14 [Mon…    22 1 [Two … NL22 [Gel…
#> # … with 25 more rows, and 28 more variables: d7 <dbl+lbl>, d8 <dbl+lbl>,
#> #   d25 <dbl+lbl>, d60 <dbl+lbl>, qa10_3 <dbl+lbl>, qa10_2 <dbl+lbl>,
#> #   qa10_1 <dbl+lbl>, qa7_4 <dbl+lbl>, qa7_2 <dbl+lbl>, qa7_3 <dbl+lbl>,
#> #   qa7_1 <dbl+lbl>, qa7_5 <dbl+lbl>, qd3_1 <dbl+lbl>, qd3_2 <dbl+lbl>,
#> #   qd3_3 <dbl+lbl>, qd3_4 <dbl+lbl>, qd3_5 <dbl+lbl>, qd3_6 <dbl+lbl>,
#> #   qd3_7 <dbl+lbl>, qd3_8 <dbl+lbl>, qd3_9 <dbl+lbl>, qd3_10 <dbl+lbl>,
#> #   qd3_11 <dbl+lbl>, qd3_12 <dbl+lbl>, qd3_13 <dbl+lbl>, qd3_14 <dbl+lbl>, …