y2municipal
is the flagship package from Y2 Analytics to automate municipal reports. It relies heavily on other y2 packages, y2clerk
and orderlabel
, so be sure to have those installed first.
The goal of y2municipal
is to quickly and easily go through the standard processes used in every municipal project of:
topline()
- uses freqs(unweighted_ns = TRUE under the hood)read_data_names_fonts()
And the development version from GitHub with:
# install.packages("devtools")
devtools::install_github("nick-moffitt/y2municipal")
Below you will find a few basic examples which show you how to quickly get a frequencies table with freqs()
:
library(dplyr)
#>
#> Attaching package: 'dplyr'
#> The following objects are masked from 'package:stats':
#>
#> filter, lag
#> The following objects are masked from 'package:base':
#>
#> intersect, setdiff, setequal, union
library(y2clerk)
library(orderlabel)
library(y2municipal)
# Run a weighted frequencies with unweighted ns
frequencies <- municipal_data %>%
freqs_wuw(s_sex)
# Run a topline
DATA_PATH <- '~/Desktop/'
municipal_data %>% topline(weight_var = weights)
#> Warning in names_checker(dataset, {: The following variables from your dataset were not included in the topline:
#> d_yearborn
If you have issues using y2municipal, please post your issue on GitHub along with a minimal reproducible example. We will do our best to address your issues and get them fixed for the next version of y2municipal.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.