There are many excellent R resources for visualization, data science, and package development. Hundreds of scattered vignettes, web pages, and forums explain how to use R in particular domains. But little has been written on how to simply make R work effectively—until now. This hands-on book teaches novices and experienced R users how to write efficient R code.
Drawing on years of experience teaching R courses, authors Colin Gillespie and Robin Lovelace provide practical advice on a range of topics—from optimizing the set-up of RStudio to leveraging C++—that make this book a useful addition to any R user’s bookshelf. Academics, business users, and programmers from a wide range of backgrounds stand to benefit from the guidance in Efficient R Programming.
Get advice for setting up an R programming environment
Explore general programming concepts and R coding techniques
Understand the ingredients of an efficient R workflow
Learn how to efficiently read and write data in R
Dive into data carpentry—the vital skill for cleaning raw data
Optimize your code with profiling, standard tricks, and other methods
Determine your hardware capabilities for handling R computation
Maximize the benefits of collaborative R programming
Accelerate your transition from R hacker to R programmer
Colin Gillespie is Senior lecturer (Associate professor) at Newcastle University, UK. His research interests are high-performance computing and Bayesian statistics. He is regularly employed as a consultant by Jumping Rivers and has been teaching R since 2005.
Robin Lovelace is a researcher at the Leeds Institute for Transport Studies (ITS) and the Leeds Institute for Data Analytics (LIDA). Robin has many years using R for academic research and has taught numerous R courses at all levels. He has developed a number of popular R resources, including Introduction to Visualising Spatial Data in R and Spatial Microsimulation with R (Lovelace and Dumont 2016). These skills have been applied on a number of projects with real-world applications, including the Propensity to Cycle Tool, a nationally scalable interactive online mapping application and the stplanr package.
The animal on the cover of Efficient R Programming is the grey heron (Ardea cinerea). Grey herons are large wading birds, measuring up to 100 cm in height with a nearly200 cm wingspan. They are long-legged, which lets them easily wade in the shallowsof their native wetland habitat. They hunt fish, amphibians, small mammals, andinsects by standing motionless in shallow water throughout the day, then strikingunsuspecting prey with their long bill. At night, they roost in trees or on cliffs, wherethey also lay eggs and raise their young.
Grey herons can be found throughout Europe, Asia, and Africa. Most gray heronslive in the same region year round, but those living in colder northern regionsmigrate south for the winter. They are mostly grey in color, with a white neck andblack streaks on the head and wings.
Grey herons have been a part of several ancient mythological systems. During theNew Kingdom period in Egypt, the deity Bennu, god of the sun, creation, and rebirth,was represented as a grey heron. In pre-Christian Rome, the gray heron was a symbolof divinination used by priests to predict the future.