Articles by Karl Broman

Write unit tests!

December 7, 2015 | Karl Broman

Since 2000, I’ve been working on R/qtl, an R package for mapping the genetic loci (called quantitative trait loci, QTL) that contribute to variation in quantitative traits in experimental crosses. The Bioinformatics paper about it is my most cited; also see my 2014 JORS paper, “Fourteen years of R/qtl: ... [Read more...]

Fitting linear mixed models for QTL mapping

November 24, 2015 | Karl Broman

Linear mixed models (LMMs) have become widely used for dealing with population structure in human GWAS, and they’re becoming increasing important for QTL mapping in model organisms, particularly for the analysis of advanced intercross lines (AIL), which often exhibit variation in the relationships among individuals. In my efforts on ... [Read more...]

Session info from R/Travis

September 25, 2015 | Karl Broman

For the problem I reported yesterday, in which my R package was working fine locally but failing on Travis, the key solution is to run update.packages(ask=FALSE) locally, and maybe even update.packages(ask=FALSE, type="source") to be sure to grab the source of packages for which ... [Read more...]

It’s not you, it’s me

September 24, 2015 | Karl Broman

Somehow when my code stops working, my first (and second, and third) reaction is to blame everything except my own code. (“It’s not me, it’s you.”) And almost always, it’s my own code that’s the problem (hence the title of this post). I spent the day ... [Read more...]

Randomized Hobbit

June 22, 2015 | Karl Broman

@wrathematics pointed me to his ngram R package for constructing and simulating from n-grams from text. I’d recently grabbed the text of the hobbit, and so I applied it to that text, with amusing results. Here’s the code I used to grab the text. Then calculate the ngrams ... [Read more...]

Initial steps towards reproducible research

December 4, 2014 | Karl Broman

In anticipation of next week’s Reproducible Science Hackathon at NESCent, I was thinking about Christie Bahlai’s post on “Baby steps for the open-curious.” Moving from Ye Olde Standard Computational Science Practice to a fully reproducible workflow seems a monumental task, but partially reproducible is better than not-at-all reproducible, ... [Read more...]

Error notifications from R

September 4, 2014 | Karl Broman

I’m enthusiastic about having R notify me when my script is done. But among my early uses of this, my script threw an error, and I never got a text or pushbullet about that. And really, I’m even more interested in being notified about such errors than anything ... [Read more...]

Notifications from R

September 3, 2014 | Karl Broman

You just sent a long R job running. How to know when it’s done? Have it notify you by beeping, sending you a text, or sending you a notification via pushbullet! beepr You can use Rasmus Bååth’s beepr package to have your computer play a sound. Install ... [Read more...]

Yet another R package primer

August 28, 2014 | Karl Broman

Hadley Wickham is writing what will surely be a great book about the basics of R packages. And Hilary Parker wrote a very influential post on how to write an R package. So it seems like that topic is well covered. Nevertheless, I’d been thinking for some time that ... [Read more...]

Testing an R package’s interactive graphs

August 1, 2014 | Karl Broman

I’ve been working on an R package, R/qtlcharts, with D3-based interactive graphs for quantitative trait locus mapping experiments. Testing the interactive charts it produces is a bit of a pain. It seems like I pretty much have to just open a series of examples in a web ... [Read more...]

UseR 2014, days 3-4

July 21, 2014 | Karl Broman

Three weeks ago, I’d commented on the first two days of the UseR 2014 conference. I’m finally back to talk about the second half. Dirk Eddelbuettel on Rcpp Dirk Eddelbuettel gave a keynote on Rcpp [slides]. The goal of Rcpp is to have “the speed of C++ with the ... [Read more...]

Why hadn’t I written a function for that?

July 16, 2014 | Karl Broman

I’m often typing the same bits of code over and over. Those bits of code really should be made into functions. For example, I’m still using base graphics. (ggplot2 is on my “to do” list, really!) Often some things will be drawn with a slight overlap of the ... [Read more...]

2014 UseR conference, days 1-2

July 2, 2014 | Karl Broman

I’m at UCLA for the UseR Conference. I attended once before, and I really enjoyed it. And I’m really enjoying this one. I’m learning a ton, and I find the talks very inspiring. In my comments below, I give short shrift to some speakers (largely by not ... [Read more...]

Further points on crayon colors

May 9, 2014 | Karl Broman

I saw this great post on crayola crayon colors at the Learning R blog, reproducing a nice graph of the Crayola crayon colors over time. (Also see this even nicer version.) The Learning R post shows how to grab the crayon colors from the wikipedia page, “List of Crayola crayon ... [Read more...]

Two more points about crayon colors

May 8, 2014 | Karl Broman

If you want to use crayon colors in R but you don’t want to rely on my R/broman package, you can just grab the code. Copy the relevant lines from the R/brocolors.R file: I spent a bit of time thinking about how best to sort the ... [Read more...]

Crayon colors in R

May 7, 2014 | Karl Broman

Last night I was working on a talk on creating effective graphs. Mostly, I needed to update the colors, as there’d been some gaudy ones in its previous form (e.g., slide 22). I usually pick colors using the crayons in the Mac Color Picker. But that has just 40 crayons, ... [Read more...]

“[” with the apply() functions, revisited

April 29, 2014 | Karl Broman

I’d mentioned in the fall that one could use "[" in the apply-type functions, like this: I just realized that you can use this with matrices, too. If you have a list of matrices, you can pull out rows and columns with this technique. As you can see, my data ... [Read more...]

Googling errors

February 14, 2014 | Karl Broman

@roguelynn tweeted the other day: If attendees of this weekend’s intro to python workshop leave with one thing, it’ll be to Google your error messages first and foremost. I had just talked about the technique in my Tools for Reproducible Research course, and I had a few recent ... [Read more...]

knitr in a knutshell tutorial

February 6, 2014 | Karl Broman

I spent a lot of time this week writing a short tutorial on knitr: knitr in a knutshell. This is my third little tutorial. (The previous ones were a git/github guide and a minimal make tutorial.) I’m pleased with these tutorials. In learning new computing skills, it can ... [Read more...]
1 2 3

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)