The surveydata package exposes functionality to support some of the dplyr verbs, e.g. dplyr::filter(). The computation is performed by dplyr, and the resulting object is of class surveydata (as well as the dplyr result).

# S3 method for surveydata
mutate(.data, ...)

# S3 method for surveydata
as_tibble(x, ..., .name_repair, rownames)

# S3 method for surveydata
as.tbl(x, ...)

# S3 method for surveydata
select(.data, ...)

# S3 method for surveydata
arrange(.data, ...)

# S3 method for surveydata
summarise(.data, ...)

# S3 method for surveydata
summarize(.data, ...)

# S3 method for surveydata
slice(.data, ...)

Arguments

.data

surveydata object or tbl passed to dplyr verb

...

passed to dplyr verb

Examples

withr::with_package("dplyr", {
  membersurvey %>% 
    as_tibble() %>% 
    .[c("id", "Q1", "Q2")] %>% 
    filter(Q2 == 2009)
})
#> # A tibble: 20 × 4
#>       id  Q1_1  Q1_2 Q2   
#>    <dbl> <dbl> <dbl> <ord>
#>  1     3     8   2   2009 
#>  2    21    12   2.5 2009 
#>  3    31    20   5   2009 
#>  4    66    25   2   2009 
#>  5    89     7   2.5 2009 
#>  6   116     7  20   2009 
#>  7   142    12   3   2009 
#>  8   146    NA  26   2009 
#>  9   194     5   2   2009 
#> 10   195    20  10   2009 
#> 11   197    25  14   2009 
#> 12   214    25   2   2009 
#> 13   219    27   2   2009 
#> 14   221    20   1   2009 
#> 15   222    19   7   2009 
#> 16   239    11   4   2009 
#> 17   253    12   7   2009 
#> 18   255    31  11   2009 
#> 19   269    45  25   2009 
#> 20   276     5  10   2009