Joscelin’s Favorite Packages & Functions
- ❇️ grateful: Facilitate citation of R packages 💯
- Added Mon Apr 24, 2023
The goal of grateful is to make it very easy to cite R and the R packages used in any analyses, so that package authors receive their deserved credit. By calling a single function, grateful will scan the project for R packages used and generate a BibTeX file containing all citations for those packages.
grateful can then generate a new document with citations in the desired output format (Word, PDF, HTML, Markdown). These references can be formatted for a specific journal, so that we can just paste them directly into our manuscript or report.
- Link to package: https://pakillo.github.io/grateful/
This a package developed by David Robinson, Julia Siege and Kanishka Misra that un-tidys the dataset into a wide matrix, performs some processing, then re-tidys the dataset. This package wraps the pattern of un-tidying data into a wide matrix, performing some processing, then turning it back into a tidy form. This is useful for several mathematical operations such as co-occurrence counts, correlations, or clustering that are best done on a wide matrix. 1. Link to repo here: https://github.com/dgrtwo/widyr
- ❇️ Reproducibility with {gtsummary} by Daniel D. Sjoberg and Karissa Whiting 💯
- Link to slides here: http://www.danieldsjoberg.com/rmedicine-gtsummary/#1
❇️ colorblindr by Claire D. McWhite & Claus O. Wilke
What is this?
Simulate colorblindness in production-ready R figures. 💯
- Link to repo here: https://github.com/clauswilke/colorblindr
- Link to the simulator: http://hclwizard.org/cvdemulator/
ggeasy 💯 This package makes using ggplot2 way much easier. Check it out.
❇️ DataEditR by Dillon Hammill💯 What is this? Manual data entry and editing in R can be tedious, especially if you have limited coding experience and are accustomed to using software with a Graphical User Interface (GUI). DataEditR is an R package built on shiny and rhandsontable that makes it easy to interactively view, enter, filter and edit data. If you are new to DataEditR visit https://dillonhammill.github.io/DataEditR/ to get started.
- Link to package’s site here: https://dillonhammill.github.io/DataEditR/
❇️ The magick package: Advanced Image-Processing in R: The new magick package is an ambitious effort to modernize and simplify high-quality image processing in R. It wraps the ImageMagick STL which is perhaps the most comprehensive open-source image processing library available today.
❇️ See slides as tiles!: if you use xaringan: install {xaringanExtra} and add this chunk to the beginning of your slides to get this nifty tile overview! (press “o” to see it: xaringanExtra::use)_xaringan_extra(c(“title_view”)
❇️ traceback: By default traceback() prints the call stack of the last uncaught error, i.e., the sequence of calls that lead to the error. This is useful when an error occurs with an unidentifiable error message. It can also be used to print the current stack or arbitrary lists of deparsed calls.
❇️ debug: Set, unset or query the debugging flag on a function. The text and condition arguments are the same as those that can be supplied via a call to browser. They can be retrieved by the user once the browser has been entered, and provide a mechanism to allow users to identify which breakpoint has been activated.
❇️ tmap: visualizing spatiotemporal data. This package allows you to create thematic maps.
Link to repo: https://github.com/mtennekes/tmap
Link to repo: https://cran.r-project.org/web/packages/tmap/vignettes/tmap-getstarted.html
- ❇️ Arrow: The arrow package, created by Ursa Labs allows for the fast loading and processing of large data.
- Link to repo: https://arrow.apache.org/docs/r/
- ❇️ funneljoin: allows you to do time-based joins to analyze a sequence of events. With this package you can analyze behavior funnels.
- Link to blog here: https://hookedondata.org/introducing-the-funneljoin-package/
- Link to repo here: https://github.com/robinsones/funneljoin
- ❇️ fable: Fable provides a collection of time series forecasting models. According to the fables READ.me on Github, these models work within the fable framework, which provides the tools to evaluate, visualize, and combine models in a workflow consistent with the tidyverse.
- Link to repo: https://github.com/tidyverts/fable
- ❇️ parameters💯: parameters’ primary goal is to provide utilities for processing the parameters of various statistical models (see here for a list of supported models). Beyond computing p-values, CIs, Bayesian indices and other measures for a wide variety of models, this package implements features like bootstrapping of parameters and models, feature reduction (feature extraction and variable selection), or tools for data reduction like functions to perform cluster, factor or principal component analysis.
- Another important goal of the parameters package is to facilitate and streamline the process of reporting results of statistical models, which includes the easy and intuitive calculation of standardized estimates or robust standard errors and p-values. parameters therefor offers a simple and unified syntax to process a large variety of (model) objects from many different packages.
- Link to repo: https://easystats.github.io/parameters/reference/index.html#section-factors-and-principal-components
❇️ pipediff💯💯 [GREAT FOR TEACHING]:
pipediff()
Overrides the pipe%>%
in the caller environment, the newly created pipe displays in the viewer the diffs between steps, then self destruct (sopipediff()
works "only once", a bit like `debugonce()).pipediff(once = FALSE)
makes the change permanent in the caller environment untilpipediff::pipereset()
is called.- Link to repo: https://github.com/moodymudskipper/pipediff
- ❇️ esquisse add-in Added Feb 2nd, 2022
Excerpt from site: This addin allows you to interactively explore your data by visualizing it with the ggplot2 package. It allows you to draw bar plots, curves, scatter plots, histograms, boxplot and sf objects, then export the graph or retrieve the code to reproduce the graph.- See online documentation : https://dreamrs.github.io/esquisse/index.html
- Link to package here: https://github.com/dreamRs/esquisse
- ❇️ correlation Added Feb 2nd, 2022
- Excerpt from site: Performs a correlation analysis.
- Link to package here: https://easystats.github.io/correlation/reference/correlation.html
- ❇️ session_info: Print session information Added Feb 2nd, 2022
- Excerpt from site: Performs a correlation analysis.
- Link to function here: https://rdrr.io/cran/sessioninfo/man/session_info.html
*** What I like to use if I want a list of all packages with an asterisk if I have them in this script: library(sessioninfo)
library(sessioninfo)
session_info(pkgs="!loaded", to_file = TRUE)
** What I like to use for reports and sharing scripts:
library(sessioninfo)
session_info(pkgs="!attached", to_file = TRUE)