Skip to content

Commit

Permalink
long overdue spell checking
Browse files Browse the repository at this point in the history
  • Loading branch information
gergness committed Oct 5, 2019
1 parent efff924 commit ef36db8
Show file tree
Hide file tree
Showing 24 changed files with 50 additions and 50 deletions.
2 changes: 1 addition & 1 deletion R/as_survey.r
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ as_survey.twophase2 <- function(.data, ...) {
#'
#' srvyr has updated it's standard evaluation semantics to match dplyr 0.7, so
#' these underscore functions are no longer required (but are still supported
#' for backward compatbility reasons). See \code{\link[dplyr]{se-deprecated}} or the
#' for backward compatibility reasons). See \code{\link[dplyr]{se-deprecated}} or the
#' dplyr vignette on programming (\code{vignette("programming", package =
#' "dplyr")}) for more details.
#' @name srvyr-se-deprecated
Expand Down
6 changes: 3 additions & 3 deletions R/as_survey_rep.r
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,18 @@
#' @export
#' @param .data A data frame (which contains the variables specified below)
#' @param variables Variables to include in the design (default is all)
#' @param repweights Variables specifying the replication weight varibles
#' @param repweights Variables specifying the replication weight variables
#' @param weights Variables specifying sampling weights
#' @param type Type of replication weights
#' @param combined_weights \code{TRUE} if the \code{repweights} already
#' include the sampling weights. This is usually the case.
#' @param rho Shrinkage factor fo rweights in Fay's method
#' @param rho Shrinkage factor for weights in Fay's method
#' @param bootstrap_average For \code{type = "bootstrap"}, if the bootstrap
#' weights have been averaged, gives the number of iterations averaged over.
#' @param scale,rscales Scaling constant for variance, see
#' \code{\link[survey]{svrepdesign}} for more information.
#' @param fpc,fpctype Finite population correction information
#' @param mse if \code{TRUE}, compute varainces based on sum of squares
#' @param mse if \code{TRUE}, compute variances based on sum of squares
#' around the point estimate, rather than the mean of the replicates
#' @param ... ignored
#' @param compress if \code{TRUE}, store replicate weights in compressed form
Expand Down
6 changes: 3 additions & 3 deletions R/as_survey_twophase.r
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,16 @@
#'
#' @export
#' @param .data A data frame (which contains the variables specified below)
#' @param id list of two sets of variable names for sampling unit identifers
#' @param id list of two sets of variable names for sampling unit identifiers
#' @param strata list of two sets of variable names (or \code{NULLs}) for stratum identifiers
#' @param probs list of two sets of variable names (or \code{NULLs}) for sampling probabilities
#' @param weights Only for method = "approx", list of two sets of variable names (or \code{NULLs})
#' for sampling weights
#' @param fpc list of two sets of variables (or \code{NULLs} for finite population corrections
#' @param subset bare name of a variable which specifies which observations are selected in phase 2
#' @param method "full" requires (much) more memory, but gives unbiased variance estimates for
#' general multistage designs at both phases. "simple" or "approx" use less memory, and is correect for
#' designs with simple random sampling at phase one and stratifed randoms sampling at phase two. See
#' general multistage designs at both phases. "simple" or "approx" use less memory, and is correct for
#' designs with simple random sampling at phase one and stratified randoms sampling at phase two. See
#' \code{\link[survey]{twophase}} for more details.
#' @param ... ignored
#' @return An object of class \code{tbl_svy}
Expand Down
2 changes: 1 addition & 1 deletion R/group-by.r
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ group_vars.tbl_svy <- function(x) {
#' On \code{tbl_svy} objects, \code{group_by} sets up the object for
#' operations similar to those allowed in \code{\link[survey]{svyby}}.
#' @param .data A tbl
#' @param ... variables to gorup by. All tbls accept variable names, some will
#' @param ... variables to group by. All tbls accept variable names, some will
#' also accept functions of variables. Duplicated groups will be silently dropped.
#' @param add By default, when \code{add = FALSE}, \code{group_by} will override
#' existing groups. To instead add to the existing groups, use \code{add = TRUE}
Expand Down
2 changes: 1 addition & 1 deletion R/lazy_tbl.r
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ find_vars_to_collect <- function(var_names, expr) {

#' Force computation of a database query
#'
#' \code{collect} retreives data from a database query (and when run
#' \code{collect} retrieves data from a database query (and when run
#' on a tbl_svy object adjusts weights accordingly). Use collect when
#' you want to run a function from the survey package on a srvyr db
#' backed object. \code{compute} stores results in a remote temporary
Expand Down
4 changes: 2 additions & 2 deletions R/manip.r
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ filter_.tbl_svy <- function(.data, ..., .dots) {
#' \code{select} and \code{rename} keep or rename variables. See
#' \code{\link[dplyr]{select}} for more details.
#'
#' \code{filter} keeps certain observaions. See \code{\link[dplyr]{filter}}
#' \code{filter} keeps certain observations. See \code{\link[dplyr]{filter}}
#' for more details.
#'
#' \code{arrange} is not implemented for \code{tbl_svy} objects. Nor are any
Expand Down Expand Up @@ -150,7 +150,7 @@ NULL

#' Manipulate multiple columns.
#'
#' See \code{\link[dplyr]{summarize_all}} for more details. *_each functions will be depracated
#' See \code{\link[dplyr]{summarize_all}} for more details. *_each functions will be deprecated
#' in favor of *_all/*_if/*_at functions.
#'
#' @name summarise_all
Expand Down
2 changes: 1 addition & 1 deletion R/srvyr.r
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#' svrvyr: A package for 'dplyr'-Like Syntax for Summary Statistics of Survey Data.
#' srvyr: A package for 'dplyr'-Like Syntax for Summary Statistics of Survey Data.
#'
#' The srvyr package provides a new way of calculating summary statistics
#' on survey data, based on the dplyr package. There are three stages to using
Expand Down
2 changes: 1 addition & 1 deletion R/survey_count_tally.R
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#' Count/tally survey weighted observations by group
#'
#' Analagous to \code{\link[dplyr]{tally}} and count, calculates the survey weighted
#' Analogous to \code{\link[dplyr]{tally}} and count, calculates the survey weighted
#' count of observations. \code{survey_tally} will call \code{\link{survey_total}} empty (resulting
#' in the count of each group) or on \code{wt} if it is specified (resulting in the
#' survey weighted total of \code{wt}). \code{survey_count} is similar, but calls \code{group_by}
Expand Down
2 changes: 1 addition & 1 deletion R/svy_context.R
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Functions modelled on the tidyselect functions for telling functions within
# Functions modeled on the tidyselect functions for telling functions within
# summarize what the survey is. I think they are a little overly complex - I
# can't really imagine having one already set and and setting another, but just
# in case, I keep that code.
Expand Down
4 changes: 2 additions & 2 deletions README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ install.packages("srvyr")

## Example usage

First, describe the variables that define the survey's stucture with the function
First, describe the variables that define the survey's structure with the function
`as_survey()`with the bare column names of the names that you would use in functions
from the survey package like `survey::svydesign()`, `survey::svrepdesign()` or
`survey::twophase()`.
Expand Down Expand Up @@ -89,7 +89,7 @@ summary(my_model)

> 1. Yay!
>
> --<cite>Thomas Lumley, [in the Biased and Inefficent blog](http://notstatschat.tumblr.com/post/161225885311/pipeable-survey-analysis-in-r)</cite>
> --<cite>Thomas Lumley, [in the Biased and Inefficient blog](http://notstatschat.tumblr.com/post/161225885311/pipeable-survey-analysis-in-r)</cite>

## Contributing
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@ install.packages("srvyr")

## Example usage

First, describe the variables that define the survey’s stucture with the
function `as_survey()`with the bare column names of the names that you
would use in functions from the survey package like
First, describe the variables that define the survey’s structure with
the function `as_survey()`with the bare column names of the names that
you would use in functions from the survey package like
`survey::svydesign()`, `survey::svrepdesign()` or `survey::twophase()`.

``` r
Expand Down Expand Up @@ -125,7 +125,7 @@ summary(my_model)
> 1. Yay\!
>
> –<cite>Thomas Lumley, [in the Biased and Inefficent
> –<cite>Thomas Lumley, [in the Biased and Inefficient
> blog](http://notstatschat.tumblr.com/post/161225885311/pipeable-survey-analysis-in-r)</cite>
## Contributing
Expand Down
6 changes: 3 additions & 3 deletions man/as_survey_rep.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions man/as_survey_twophase.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/collect.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/current_svy.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/dplyr_single.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/group_by.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 7 additions & 7 deletions man/srvyr-se-deprecated.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/srvyr.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/summarise_all.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/survey_tally.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions vignettes/extending-srvyr.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,14 @@ survey objects work. If you'd like more explanation, please let me know on
[github](https://github.com/gergness/srvyr)!

## Translating from survey to srvyr
srvyr implements the "survey tatistics" functions from the survey package. Some examples
srvyr implements the "survey statistics" functions from the survey package. Some examples
are the svymean, svytotal, svyciprop, svyquantile and svyratio all return a
`svystat` object which usually prints out the estimate and its standard error
and other estimates of the variance can be calculated from it. In srvyr, these
estimates are created inside of a summarize call and the variance estimates are
specified at the same time.

The combination of srvyr's group_by and summarize is analagous to the `svyby`
The combination of srvyr's group_by and summarize is analogous to the `svyby`
function that performs one of the survey statistic function and performs it on
multiple groups.

Expand Down Expand Up @@ -66,7 +66,7 @@ should be:
srvyr now exports several functions that can help convert functions designed
for the survey package to this format.

- `current_svy()` - This function, modelled after `dplyr::current_vars()`,
- `current_svy()` - This function, modeled after `dplyr::current_vars()`,
is a hidden way to send the survey object to the object (by hidden, I mean
that the user doesn't have to specify the survey in the arguments of their
function call). To use it, have an argument in your functions that
Expand Down
10 changes: 5 additions & 5 deletions vignettes/srvyr-database.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,11 @@ This vignette shows the basics of how to use srvyr with databases.
It is based on analysis from the wonderful resource asdfree
( [website](http://asdfree.com/) and [github](https://github.com/ajdamico/asdfree) ).
Many thanks to [ajdamico](http://github.com/ajdamico) and collaborators.
Specifically, I have adpated code from [American Community Survey - 2011 single year analysis](https://github.com/ajdamico/asdfree/blob/d0b965e9672161da086e30471760d08281b74343/American%20Community%20Survey/2011%20single-year%20-%20analysis%20examples.R) and the associated data preparation scripts.
Specifically, I have adapted code from [American Community Survey - 2011 single year analysis](https://github.com/ajdamico/asdfree/blob/d0b965e9672161da086e30471760d08281b74343/American%20Community%20Survey/2011%20single-year%20-%20analysis%20examples.R) and the associated data preparation scripts.

## Database Setup ##
In order to focus on srvyr and databases, we start with a prepared dataset. The full code
is avaliable [on Github](https://github.com/gergness/srvyr/blob/master/vignettes/save_acs_data.R), and the high level description of what it does is:
is available [on Github](https://github.com/gergness/srvyr/blob/master/vignettes/save_acs_data.R), and the high level description of what it does is:

- Download data from acs website (currently only Alaska and Hawaii to save time,
though it would be easy to adapt to download to all 50 states and Puerto Rico).
Expand Down Expand Up @@ -161,7 +161,7 @@ specific database packages, like `RSQLite`.

## Srvyr Setup ##
Srvyr commands are nearly identical to old. The only difference for setup is that you
need a variable that uniquely identifieds each row in the database (uid).
need a variable that uniquely identifies each row in the database (uid).

```{r}
acs_m_db_svy <- acs_m_db %>%
Expand Down Expand Up @@ -193,8 +193,8 @@ Analysis commands from srvyr are also similar to ones that work on local data.fr
The main differences come from the issues discussed above about explicitly creating variables
difficulties in translating R commands, and variable types.

The following anlaysis is based on the asdfree analysis and shows some basi analysis on
the total populaiton, insurance coverage, age and sex.
The following analysis is based on the asdfree analysis and shows some basic analysis on
the total population, insurance coverage, age and sex.

```{r}
# You can calculate the population of the united states #
Expand Down
Loading

0 comments on commit ef36db8

Please sign in to comment.