knitr::opts_chunk$set( collapse = TRUE, comment = "#>", fig.path = "man/figures/README-", out.width = "100%" )
The goal of summerr
is to centralize the frequently used and some of the more
exotic R functions and routines encountered during import, export, and processing
of primary research data in the lab.
Many of these functions are re-used (imported) by more specialized packages of the
summerr
family.
Since this package is not part of CRAN, you must install and update the development version from GitHub with:
# install.packages("devtools") devtools::install_github("benjbuch/summerr")
Once installed, the suite can be updated using:
summerr::update_summerr() # expands to other packages if loaded
Some examples of general utility.
library(summerr)
Interactive access to files and folders through RStudio API (if available; else console-based chooser).
# select, e.g., an Excel file, ... my_file <- select_single_file(suffix = "xlsx") # ... or choose an entire directory to take forward my_dir <- select_directory()
For example, a facility to import a 384-well plate layout created in Excel with metadata columns/rows:
my_file <- system.file("extdata", "platelayout_maldi.xlsx", package = "summerrmass")
my_layout <- import_layout_from_excel(file = my_file, meta_row = c(concentration = "1")) my_layout display_plate_layout(my_layout, fill = content, alpha = as.numeric(concentration)) + ggplot2::labs(alpha = "Compound Concentration", fill = NULL)
Calling broom::tidy
, broom::glance
and broom::augment
on model fitted to
each group of a grouped data frame and returning, fail-safe, these aspects:
library(magrittr) # for the pipe operator iris %>% dplyr::group_by(Species) %>% model_cleanly_groupwise(lm, formula = Sepal.Length ~ Sepal.Width)
You can use model_display
to visualize the fit.
iris %>% dplyr::group_by(Species) %>% model_cleanly_groupwise(lm, formula = Sepal.Length ~ Sepal.Width) %>% model_display(color = Species)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.