Packages 2023 Wrapped

r-pkg

A quick look at my R package updates this year.

Author
Published

December 21, 2023

With CRAN closing its submission queue for the holiday break tomorrow, it seems the right time to look over the past year. I maintain and contribute to quite a few packages on CRAN, primarily focused on social science data and methods. This year included adding 5 new packages to CRAN, with a minor shift towards tidy interfaces for web-based APIs. Below, I talk about some of the new packages, updates to existing packages, and then look at the downloads for all of my packages.

Updates on CRAN

New packages

I’ve added five new packages to CRAN this year.

apportion

apportion is a relatively simple package. It calculates apportionments, the allocation of seats to states based on population. It includes functions for the most common apportionment methods:

  • the Adams Method (app_adams())
  • the Balinski Young Method (app_balinski_young())
  • the Dean Method (app_dean())
  • the D’Hondt Method (app_dhondt())
  • the Hamilton-Vinton Method (app_hamilton_vinton())
  • the Huntington-Hill Method (app_huntington_hill())
  • the Jefferson Method (app_jefferson())
  • the Webster Method (app_webster())

crayons

crayons takes a few dozen packs of crayons and turns them into color palettes. The package itself is pretty thin, relying on scale_color_crayons() and scale_fill_crayons() to create the palettes.

library(ggplot2)
library(crayons)

mpg |>
  ggplot() + 
  geom_point(aes(displ, hwy, colour = class)) + 
  scale_color_crayons(palette = 'original') + 
  theme_bw()

gptzeror

In the peak of worries about students using ChatGPT, GPTZero offered an API for estimating if text was human or AI generated. I wrapped an R interface to this API in gptzeror. It seems to work somewhat well, but is far from perfect. The risk of false positives is really high, so I’m not using this without other substantial evidence.




feltr

feltr is a package for working with the Felt. It covers all of the API endpoints, which lets you upload shapes from R directly to Felt. You can delete them, update them, extract comments, and more. I covered an application of this package in a prior blog post on loosely focused on Dunkin Donuts in Cambridge.





bskyr

bskyr is a package for working with the Bluesky Social API. It’s focused largely on collecting tidy data from Bluesky. Given the decentralized nature of Bluesky, it seems like it has immense opportunity for social science research. You can design entire feeds as treatments, letting people push further in treatment arms without the same need for industry-academy partnerships as with Facebook or X/Twitter.

Of course, it also contains all of the tools for posting and otherwise interacting with Bluesky. I even have a small bot going which tracks CRAN Updates that I’ll cover soon in a holiday-times blog post. It’s run entirely through bskyr, which has been working even better than expected.

Updates to existing packages

My CRAN updates have not all been new packages, I also maintain a handful of packages. This year, I’ve made 14 submissions across 10 packages. 7 of these are related to the 5 new packages above (5 first submission + 2 updates).

Name Version Date Title
cvap 0.1.3 2023-03-17 Citizen Voting Age Population
redist 4.1.0 2023-03-19 Simulation Methods for Legislative Redistricting
redist 4.1.1 2023-04-03 Simulation Methods for Legislative Redistricting
geomander 2.2.1 2023-04-16 Geographic Tools for Studying Gerrymandering
cvap 0.1.4 2023-07-01 Citizen Voting Age Population
tinytiger 0.0.8 2023-10-17 Lightweight Interface to TIGER/Line Shapefiles
redistmetrics 1.0.7 2023-12-12 Redistricting Metrics

Updates to cvap and tinytiger added support for new years of Census Bureau data. redist and redistmetrics each saw primarily bug fixes and performance improvements, without any major changes. geomander similar saw mostly bug fixes. Its one update also drastically cleaned up the dependencies to make the package easier to install.

Package Downloads

By downloads, my most popular package was tinytiger, a project with Cory McCartan. This was designed as a low dependency alternative to tigris for accessing Census data, primarily as a dependency for other redistverse packages.

congress surprisingly comes in at number 2. I didn’t realize people were actually using this, but glad to see it. congress provides a tidy interface to Congress.gov’s API. You can get bill text, member info, committee documents, and more.

redist had a good year, taking the bronze medal. After being used for the winning side in Allen v. Milligan, it has another chance to make a difference in the ongoing South Carolina redistricting case.

The rest of the download counts are below, with bskyr coming in last with a mere 509 downloads.