Articles by Brandon Bertelsen

Rcpp and Roxygen2

August 27, 2016 | Brandon Bertelsen

Instructions for using Rcpp and Roxygen2 together. This assumes that Roxygen2 is managing your namespace: DESCRIPTION In your DESCRIPTION file, add the line LinkingTo: Rcpp Also ensure that you import Rcpp, Imports: Rcpp along with all the other packages are imported in your namespace. Package Documentation Your package documentation (by [Read more...]

Rcpp example using NA

August 25, 2016 | Brandon Bertelsen

Dealing with NA in Rcpp can be a bit tricky to sort out, but the speed boosts are incredible and if you're dealing with large data - worth the time to figure it out. But usage cases are important to consider in the example below you can see that vectorized [Read more...]

Montreal FSA Scraping Part Dieux

August 14, 2016 | Brandon Bertelsen

Although we were able to scrape from the web the FSA we wanted, it was unfortunately not a complete list. Instead, let's try another route using some data that's been crowdsourced, namely the geocoder.ca dataset or a subset provided by aggdata (as the geocoder.ca table is 50mbs and [Read more...]

Montreal FSA Scraping

August 13, 2016 | Brandon Bertelsen

NOTE: This document does not provide a complete list of FSAs, so it's only useful for the scraping example. See Part Dieux for a more complete listing based on the economic region in question. There's no official database that I can find to define clearly some of the economic areas [Read more...]

TLS for RStudio and Shiny using Let’s Encrypt

July 14, 2016 | Brandon Bertelsen

Below is a very simple way to have https connections for the open source version of RStudio Server and Shiny Server. sudo apt-get install docker sudo apt-get install python-pip sudo pip install docker-compose Now, in your user directory, create a text file using your preferred text editor, called docker-compose.yml [Read more...]

Example gitlab-ci.yml for R Projects

June 26, 2016 | Brandon Bertelsen

Most people are running open source projects, so they can easily use github and travis for free. I don't have that luxury, but gitlab has really caught my attention lately. Combining gitlab, gitlab runner with docker makes things very straightforward. Here is an example .gitlab-ci.yml file that you would [Read more...]

Radial Plots with Plotly

June 13, 2016 | Brandon Bertelsen

How to make a radial plot without using radial coordinates with plotly. Let's load a few libraries and pull some sample data. Then do some preparation by adding data associated with turning the graphic into a circle. A trivial application of high school SOHCATTOA, and finally plot. Comments included at [Read more...]

Quick Correlation Heatmap in R

July 17, 2015 | Brandon Bertelsen

I find myself remaking this plot over and over. So here's a quick function. Also tests correlation significance. I quite like the spectral palette for the purpose of a heat map. It's not too painful on the eyes and variation is immediately identifiable. #' Create a Heatmap #' #' Function
[Read more...]

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)