Blog Archives

Templated output in R

April 28, 2019
By

Earo Wang, who is the curator for the We are R-Ladies twitter feed this week (last week of April, 2019), had a really nice tweet about using the whisker package to create a template incorporating text and data in R. Her example created a list of tidyverse packages with descriptions. I really liked the example, but thought that the glue...

Read more »

Interchanging RMarkdown and “spinnable” R

November 12, 2018
By

Dean Attali wrote this nice post a few years ago describing knitr’s spin function. This function allows a regular R file, with comments written with the roxygen2-style comment tag #' to be rendered as an HTML document with the comments rendered as text and the results of the R code rendered in place, much as a RMarkdown document would. The basic...

Read more »

Modifying Excel Files using openxlsx

October 15, 2018
By

I’ve been creating several output tables for a paper, which I usually store as sheets in an Excel file, since my collaborators are entirely in the Microsoft Office ecosystem. One issue I often run into is having to modify a single sheet in that file with updated data, while keeping the rest of the file intact. This is necessary since I’ve...

Read more »

Bootstrapping clustered data

August 29, 2018
By
Bootstrapping clustered data

When evaluating the sampling variability of different statistics, I’ll often use the bootstrap procedure to resample my data, compute the statistic on each sample, and look at the distribution of the statistic over several bootstrap samples. In principle, the bootstrap is straightforward to do. However, if you have correlated data (like repeated measures or longitudinal data or circular data), the unit of...

Read more »

Joint Statistical Meetings Talk

July 31, 2018
By

The Joint Statistical Meetings are being held in the beautiful city of Vancouver, British Columbia this year. I gave a talk on data visualization this year, which is a new one for me, but an area I’m quite excited about. I’ve been looking into the newer toolsets using Javascript graphics for a while now for different projects, and this talk...

Read more »

Cleaning up tables

May 15, 2018
By

Context One of things I have to do quite often is create tables for papers and presentations. Often the “Table 1” of a paper has descriptives about the study, broken down by subgroups. For presentation purposes, it doesn’t look good (to me, at least) that the name of each subgroup be repeated down one column of the table. One way to...

Read more »

Tidying messy Excel data (tidyxl)

May 1, 2018
By
Tidying messy Excel data (tidyxl)

Well, here’s what I was dealing with: Exemplar Excel file from collaborator Notice that we have 3 header rows, first with patient IDs, second with spine region, and third with variable names (A and B, to protect the innocent). Goal A dataset that, for each patient and each angle gives us corresponding values of A and B. So this would be a four-column data set...

Read more »

Tidying messy Excel data (Introduction)

April 30, 2018
By

Personal expressiveness, or how data is stored in a spreadsheet When you get data from a broad research community, the variability in how that data is formatted and stored is truly astonishing. Of course there are the standardized formats that are output from machines, like Next Generation Sequencing and other automated systems. That is a saving grace! But for smaller data, or...

Read more »

Surprising result when exploring Rcpp gallery

July 20, 2017
By

I’m starting to incorporate more Rcpp in my R work, and so decided to spend some time exploring the Rcpp Gallery. One example by John Merrill caught my eye. He provides a C++ solution to transforming an list of lists into a data frame, and shows impressive speed savings compared to as.data.frame. This got me thinking about how I do...

Read more »

Finding my Dropbox in R

July 4, 2017
By

I’ll often keep non-sensitive data on Dropbox so that I can access it on all my machines without gumming up git. I just wrote a small script to find the Dropbox location on each of my computers automatically. The crucial information is available here, from Dropbox. My small snippet of code is the following: if (Sys.info() == 'Darwin') { info...

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)