
<!-- README.md is generated from README.Rmd. Please edit that file -->

# surveyverse

<!-- badges: start -->

<!-- badges: end -->

The **surveyverse** package makes it easy to install and load a
collection of R packages for analyzing complex survey data. The key
package in this collection is [the **survey**
package](https://doi.org/10.32614/CRAN.package.survey) of Lumley (2004).
[The **srvyr** package](https://doi.org/10.32614/CRAN.package.srvyr) of
Freedman Ellis and Schneider (2016) extends **survey** by allowing users
to write code for survey data analysis in the style of the tidyverse.
[The **svrep** package](https://doi.org/10.32614/CRAN.package.svrep)
extends **survey**’s ability to create and use replicate weights based
on methods such as the generalized bootstrap or successive difference
replication.

Users should cite the specific packages in this collection rather than
citing surveyverse. Citations for individual packages can be obtained
using the `citation()` function, for example by calling
`citation('survey')`.

## Installation

You can install surveyverse from CRAN like so:

``` r
install.packages('surveyverse')
```

## Usage

Calling `library(surveyverse)` will load the core set of packages in the
**surveyverse** collection.

``` r
library(surveyverse)
#> ── Attaching core surveyverse packages ──────────────────── surveyverse 0.1.1 ──
#> ✔ survey 4.5       ✔ svrep  0.9.1
#> ✔ srvyr  1.3.1     
#> ── Conflicts ──────────────────────────────────────── surveyverse_conflicts() ──
#> ✖ survey::dotchart() masks graphics::dotchart()
#> ✖ srvyr::filter()    masks stats::filter()
#> ℹ Use the conflicted package to force all conflicts to become errors
#> ℹ Please cite specific packages rather than surveyverse; see `citation('surveyverse')`
```

Loading the package in this way will display any namespace conflicts
with other packages that are currently loaded.

The set of packages in the collection can be viewed by calling
`surveyverse_packages()`. The following non-core packages are installed
with surveyverse but are not loaded:

- svylme: For fitting linear mixed-effects models to complex survey data

- svyVGAM: For fitting vector generalised linear models, i.e., models
  supported by the VGAM package

The full list of core and non-core packages can be viewed by calling
`surveyverse_packages(core_only = FALSE)`.
