carbonate

Create beautiful images of your source code from R

carbon.js is the easiest way to create beautiful images of your source code, and carbonate creates an api in R to interact with it. The package gives a new simple way to share your script with the rest of the R community on posters, slides, Shiny apps and social media! This little snippet combines SO MANY of my favorite #rstats 📦s: ✨ @jimhester_'s glue 🥛 @yoniceedee's carbonate 🐦 @kearneymw's rtweet [Read More]

RStudio Addin Manager

rsam provides a command line and user interface to manage RStudio addins. You can show or hide the addins in the RStudio IDE dropdown menu and set keyboard shortcuts for them. Installation Since rsam manages the RStudio addins it must write to disk. For this reason the package cannot be hosted on CRAN. #install.packages('remotes') remotes::install_github('yonicd/rsam') Usage library(rsam) ## rsam persmissions set by ~/_rsam.yml User Interface The user interface is a shiny application that uses rhandshontable to interact with the addins. [Read More]

Firearms Sourced and Recovered in the United States and Territories 2010-2016

I want to try and probe a question that was raised since Las Vegas and now revived due to the tragedy in Sutherland Springs,TX: Given the free trade between states, can a state unilaterally regulate firearms. This post will try to start to give an answer to this question using R. Since there is not an open electronic federal database for firearm ownership and transactions, one important source of information is the Bureau of Alcohol, Tobacco and Firearms, (ATF). [Read More]

Extending slackr

The slackr package, by Bob Rudis, contains functions that make it possible to interact with the Slack messaging platform. The great part of Slack is that it has mobile devices application interface. We take advantage of this by extending slackr’s interaction with the server: Write to a channel (current) - slackr Compile TeX snippets directly to a channel - tex_slackr tex_slackr(xtable::xtable(mtcars)) This function uses the texPreview package to compile and generate the TeX output. [Read More]

jsTree htmlwidget

jsTree is a R package that is a standalone htmlwidget for the jsTree JavaScript library. It can be run from the R console directly into the Rstudio Viewer, be used in a Shiny application or be part of an Rmarkdown html output. Installation #CRAN install.packages('jsTree') #Github devtools::install_github('metrumresearchgroup/jsTree') The motivation for the package came from the shinyTree by Jeff Allen, which has an early version of the JavaScript library hardcoded into a Shiny application. [Read More]

Combining Github Traffic Plots Across Repositories

This post will show how to use the RSelenium package to scrape your own github account to retrieve all that fun traffic data of clones and visits and create a single traffic plot for your account. For the single file you can find it in this gist file. Packages library(RSelenium) library(XML) library(ggplot2) library(reshape2) library(plyr) library(dplyr) Fill in the relevant information for your account. The team is usually your username, but it can be different. [Read More]

Regular Expression Searching within Shiny Selectize Objects

regexSelect is a small package that uses Shiny modules to solve a problem in Shiny selectize objects - regular expression (regex) searching. You can quickly filter the values in the selectize object, while being able to add that new regex query to the selectize list. This is great for long lists, since you can return multiple item simultaneously without needing to endlessly click items in a list! Install install.packages('regexSelect') #devtools::install_github('yonicd/regexSelect') Below are two examples of using regular expressions to quickly populate multiple items in a ggplot and a datatable. [Read More]

What is the appropriate population scaling of the Affordable Care Act Funding?

Analysis of the effects of the Graham-Cassidy Bill on the ACA population

I have been trying to decipher for myself, what is in the current (well, yesterday’s) Graham-Cassidy health care bill. I saw this image on many news outlets a few days ago and my inner hate for pie charts bubbled up. This is a zoom in on the pie chart … From what I can gather, these figures are attempting to say that there are specific states that are getting relatively more of the federal health care funds under the Afordable Care Act (ACA) than their relative state population. [Read More]

Automating roxygen2 package documentation

Take the mystery out of CRAN level package maintenance

Thinking of creating a new package? Dread the task of function documentation? Afraid to run devtools::check(build_args = '--as-cran') and get bombarded by Errors, Warnings, and Notes (oh my!) ? Wait…. breathe! After feeling all that anxiety and following all of Hadley’s directions online, I felt I was doing a lot of manual labour, and that a package should be doing all lot of this for me. So we wrote one - sinew (sin-yu). [Read More]

sinew

a R Package to create self-populating roxygen2 skeletons

Sinew is a R package that generates a Roxygen skeleton populated with information scraped from the function script. Functionality makeOxygen: Create skeleton for Roxygen2 documentation populated with information scraped from within the package function scripts. makeImport: Create import calls for DESCRIPTION, NAMESPACE and Roxygen2 makeDictionary: Create an R file of all the unique roxygen parameter fields in a package R subdirectory. makeOxygen Function that returns the skeleton for roxygen2 documentation including title, description, return, import and other fields populated with information scraped from the function script. [Read More]