knitr::opts_chunk$set( collapse = TRUE, comment = "#>", fig.path = "README-" )
Using a standard interface, create common data results structures, such as from a linear regression or correlation. Design the analysis, add settings and variables, construct the results, and lastly scrub and polish it up.
One of the main goals of mason
is to be able to easily implement other
analyses to this infrastructure. Since, I'd argue, most statistical methods
follow a similar pattern (what are the variables, what options to use for the
method, what to select from the results), this can be easily encapsulated into a
'blueprint -> construction -> scrubbing and polishing' workflow.
mason
was designed to be best used with the magrittr
%>%
pipes, though it
doesn't need to be. It was also designed to follow the
tidy data philosophy,
specifically that everything should result in a data frame, within limits. This
makes it easier to do further analysis, visualization, and inclusion into
report formats. This flow was deliberately chosen so it works well with dplyr
,
tidyr
, ggplot2
, and many other excellent packages out there that help make
analyses easier.
The package can be installed from CRAN using:
install.packages("mason")
For the development version, install using:
# install.packages("remotes") remotes::install_github('lwjohnst86/mason')
The typical usage for this package would flow like this:
library(mason) design(iris, 'glm') %>% add_settings() %>% add_variables('yvars', c('Sepal.Length', 'Sepal.Width')) %>% add_variables('xvars', c('Petal.Length', 'Petal.Width')) %>% construct() %>% scrub() %>% polish_adjust_pvalue()
Depending on the statistical method being used, each function may have slightly different arguments.
If there are problems, create an issue and let me know what the problem is!
design
add_settings
following the naming
convention add_settings.statmethod_bp
and include the appropriate
settings to the statistical method.type
argument in the add_variables
function.add_settings
instructions above, do the same for the
construct
and scrub
S3 method.polish_
type function.Please note that this project is released with a Contributor Code of Conduct. By participating in this project you agree to abide by its terms.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.