Publications by Abhijit
A quick exploration of the ReporteRs package
The package ReporteRs has been getting some play on the interwebs this week, though it’s actually been around for a while. The nice thing about this package is that it allows writing Word and PowerPoint documents in an OS-independent fashion unlike some earlier packages. It also allows the editing of documents by using bookmarks within the docu...
1194 sym R (417 sym/1 pcs) 4 img
A (much belated) update to plotting Kaplan-Meier curves in the tidyverse
One of the most popular posts on this blog has been my attempt to create Kaplan-Meier plots with an aligned table of persons-at-risk below it under the ggplot paradigm. That post was last updated 3 years ago. In the interim, Chris Dardis has built upon these attempts to create a much more stable and feature-rich version of this function in his pac...
410 sym 4 img
Copying tables from R to Outlook
I work in an ecosystem that uses Outlook for e-mail. When I have to communicate results with collaborators one of the most frequent tasks I face is to take a tabular output in R (either a summary table or some sort of tabular output) and send it to collaborators in Outlook. One method is certainly to export the table to Excel and then copy the ...
1269 sym 4 img
Changing names in the tidyverse: An example for many regressions
A collaborator posed an interesting R question to me today. She wanted to do several regressions using different outcomes, with models being computed on different strata defined by a combination of experimental design variables. She then just wanted to extract the p-values for the slopes for each of the models, and then filter the strata based on...
1745 sym R (1009 sym/5 pcs) 4 img 2 tbl
pandas “transform” using the tidyverse
Chris Moffit has a nice blog on how to use the transform function in pandas. He provides some (fake) data on sales and asks the question of what fraction of each order is from each SKU. Being a R nut and a tidyverse fan, I thought to compare and contrast the code for the pandas version with an implementation using the tidyverse. First the pandas ...
801 sym R (349 sym/2 pcs) 4 img
Finding my Dropbox in R
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()['sysname'] == 'Darwin...
970 sym R (467 sym/1 pcs) 4 img
Quirks about running Rcpp on Windows through RStudio
Quirks about running Rcpp on Windows through RStudio This is a quick note about some tribulations I had running Rcpp (v. 0.12.12) code through RStudio (v. 1.0.143) on a Windows 7 box running R (v. 3.3.2). I also have RTools v. 3.4 installed. I fully admit that this may very well be specific to my box, but I suspect not. I kept running into proble...
2266 sym R (187 sym/1 pcs) 4 img
Surprising result when exploring Rcpp gallery
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 this oper...
1455 sym R (517 sym/3 pcs) 6 img
Moving to blogdown
I’ve been in the process of transferring my blog (along with creating a personal website) to blogdown, which is hosted on Github Pages. The new blog, or rather, the continuation of this blog, will be at webbedfeet.github.io/posts, and it went live today. I’ll be cross-posting here for a while, at least until Tal gets my new blog address inclu...
1048 sym 2 img
Tidying messy Excel data (Introduction)
[Re-posted from Abhijit’s blog] 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 au...
2776 sym 2 img