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]

slickR

The last R carousel that you'll ever need

We are happy to bring the slick JavaScript library to R. It is self described as “the last carousel you’ll ever need”. This carousel is based on putting the elements of the carousel in a div HTML tag. This makes the carousel very versatile in what can be placed inside. Regular objects that are placed in a carousel can be for example: images, plots, tables, gifs, videos, iframes and even htmlwidgets. [Read More]

ggedit 0.2.0

Crantastic!

We are pleased to announce the release of the ggedit package on CRAN. To install the package you can call the standard R command install.packages('ggedit') The source version is still tracked on github, which has been reorganized to be easier to navigate. To install the dev version: devtools::install_github('metrumresearchgroup/ggedit') What is ggedit? ggedit is an R package that is used to facilitate ggplot formatting. With ggedit, R users of all experience levels can easily move from creating ggplots to refining aesthetic details, all while maintaining portability for further reproducible research and collaboration. [Read More]