Ellis Hughes

blogs and musings of a bioengineer turned data scientist

GitHub Twitter LinkedIn

Big mtcars

MTCARS Lets admit it, the mtcars dataset is basically beat to death. Who hasn’t seen the example of regressing displacement vs mpg to show, surprise, there is a relationship. It seems like it has worked its way into every introductory R class known. So, lets go bigger Luckily for us, the kind folks over at the EPA have been hard at work reviewing how our cars are doing. Read more...

ifelse then if_else

Problem Statement Today one of my colleagues posted a question into our R slack community asking why when she was using ifelse that her date field was being converted into a numeric. date1<-as.Date(c("2019-01-01","2019-01-02","2019-01-03")) date2<-as.Date(c("2019-01-02","2018-01-02","2019-01-03")) ifelse(date1>date2,date1,date2) ## [1] 17898 17898 17899 My first instinct was that date objects (and POSIXct objects) are numeric objects that are counting the number of days or seconds since the origin (January 1, 1970 in R). Read more...

R in Pharma

Below are the slides I presented at this years R/Pharma conference. It was a blast and I met so many great people. I learned about the many ways R is being used in the industry, and how there is a huge push towards collaboration and transparancy in sharing our code. I discussed our approach to creating the documentaion required to validate an internally generated R package and lessons learned working in a group. Read more...

Arcade Games using R and TensorFlow

Reinforcement learning is an interesting technique where in the user gives a model a game state and requests that it produce some sort of reaction to the state. This action is then fed back into the model to generate the next state. If the result of this action is a positive reaction, it is recorded and the model is fit to imply this action is a good one. Read more...