Home » Analytics » This is why code written by scientists gets ugly

This is why code written by scientists gets ugly

Software

R in the Cloud

Train in R

Son of Gandhi:

brilliant piece of why scientists write bad code

Originally posted on What You're Doing Is Rather Desperate:

There’s a lot of discussion around why code written by self-taught “scientist programmers” rarely follows what a trained computer scientist would consider “best practice”. Here’s a recent post on the topic.

One answer: we begin with exploratory data analysis and never get around to cleaning it up.

An example. For some reason, a researcher (let’s call him “Bob”) becomes interested in a particular dataset in the GEO database. So Bob opens the R console and use the GEOquery package to grab the data:

1

Bob is interested in the covariates and metadata associated with the experiment, which he can access using pData().

1
pd <- pData(gse$GSE22255_series_matrix.txt.gz)
names(pd)
# [1] “title” “geo_accession”
# [3] “status” “submission_date”
# [5] “last_update_date” “type”
# [7] “channel_count” “source_name_ch1″
# [9] “organism_ch1″ “characteristics_ch1″
# [11] “characteristics_ch1.1″ “characteristics_ch1.2″
# [13] “characteristics_ch1.3″ “characteristics_ch1.4″
# [15] “characteristics_ch1.5″ “characteristics_ch1.6″
# [17] “treatment_protocol_ch1″ “molecule_ch1″
# [19]…

View original 202 more words


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Conferences

Predictive Analytics- The Book

Books

Follow

Get every new post delivered to your Inbox.

Join 831 other followers