Blog Archives

Submitting packages to CRAN

This note lists a few of the mistakes that one can make before submitting a package to CRAN. The list is based on my own mistakes when submitting the ggnetwork package to CRAN for the first time (see this other note for comments about the package itself). Single quotes around package names While the CRAN Repository Policy is short and straightforward...

Read more »

Sustainable code for social scientists

Over at his blog “One Tip per Day”, Xianjun Dong has produced an excellent list of “15 Practical Tips For a Bioinformatician”. This note is my own version of these tips, aimed at social scientists who need to write sustainable (i.e. reproducible) code for either individual or collective research projects. Required software This note is based on my experience as a...

Read more »

Scraping legislative data with R: a progress report

This note discusses the results of this project, which collects legislative data from several European parliaments (plus Israel). The project is coded in R, which has had consequences on its development. The project In a nutshell, the parlnet project scrapes private bills from 20 national parliaments, and then converts the sponsorship information of these bills into legislative cosponsorship networks, which James...

Read more »

Quick shell commands for R users

This note explains how to use an application launcher along with text expansion and shell commands to accomplish a few specific tasks that can be useful to R users. Software requirements This note assumes that you are equipped with an application launcher that supports text expansion and can process shell commands. On Mac OS X, I recommend Alfred, because the little money...

Read more »

Exponential random graph models with R

This note documents the a small but growing microverse of R packages on CRAN to produce various forms of exponential random graph models (ERGMs), which are a kind of modelling strategy akin to logistic regression for dyadic data. The starting point: ergm The gravitational centre of the ERGM microverse is the ergm package, by Handcock et al. The package is part...

Read more »

Convex hulls with <code>dplyr</code> and <code>ggplot2</code>

Convex hulls with <code>dplyr</code> and <code>ggplot2</code>

This note shows a quick way to draw convex hulls, using dplyr and ggplot2. Our example data is a dataset of European parliamentary constituencies, some of which have been successfully geocoded with the help of the ggmap package. The package taps into ...

Read more »

Scraping form results with <code>httr</code>

Scraping form results with <code>httr</code>

This note shows how to use the httr package to scrape the results of a search form. Example In this blog post, Baptiste Coulmont looks at some French nomination decrees published in the Journal officiel de la République française (JORF). Every nomination published by the French civil service is expected to be available from this JORF search form. Looking at the HTML...

Read more »

String manipulations on full names

This note shows how to use the stringr package to clean a list of full names that need to be turned into unique identifiers, i.e. something that can be assigned as row names to a data frame. Example Let’s start by getting a list of real names by scraping the 183 full names of the people currently sitting in the lower...

Read more »

Teaching with RStudio

The RStudio IDE is a central component of the R software ecology that makes it easier to code in R, or to use R with other tools. This note discusses its use in a teaching environment. Most of my teaching experience lies with Stata, but in recent years, I have also experimented teaching with R and RStudio to both undergraduate...

Read more »

Latest R bookmarks

This note shows the most recent R-related bookmarks from my Pinboard feed. Most of them come from GitHub or R-Bloggers. The links open in new tabs/windows. The bookmarks are converted from RSS to HTML by Engin Kizil’s FeedEk plugin, whic...

Read more »

Search R-bloggers

Sponsors

Never miss an update!
Subscribe to R-bloggers to receive
e-mails with the latest R posts.
(You will not see this message again.)

Click here to close (This popup will not appear again)