Publications by R on R (for ecology)
Making your first plot in R
With the new year, I’m hoping more of you take up learning R, so with that I want to share a tutorial from my course on an introduction to data visualization with R to help get you started. If you are completely new to R and don’t even know where to start, check out my last post on installing R and RStudio here. In this tutorial I’ll teach ...
4408 sym R (1066 sym/7 pcs) 10 img
The Basics of R (in Spanish!)
(¿Quieres más detalles sobre el curso en español? Desplázate hacia abajo.) Hello everyone! This blog post is a bit different from usual posts in that I’d like to make a very exciting announcement about an upcoming course launch. Part of my vision with R for Ecology is to make as accessible as possible to as many people as possible—especi...
5535 sym 2 img
How to join tables in R
In this blog post, I’m going to talk about joining data tables together. Joining tables is incredibly useful when you have to download several data files on a common set of subjects and then aggregate them into a larger, singular data set. This is pretty common with spatial data. For example, you might have one table that contains geographic in...
7039 sym R (3414 sym/10 pcs) 10 img
Introduction to missing data (NAs) in R
As many of us know, science is not a perfect process. Maybe you can’t get out in the field on a certain day. Maybe you can only sample a portion of what needs to get done. Or maybe you’re downloading public data sets and they aren’t lining up perfectly. All of these can result in missing data, which can be a real pain when it comes time for...
5899 sym R (1627 sym/9 pcs) 4 img
How to use R Markdown (part one)
Today I’m excited to share a blog post on how to use R Markdown. R Markdown is a dynamic file format that allows you to make documents containing normal text alongside chunks of embedded R code. In fact, all of my blog posts are written using R Markdown, which is how I’m able to write text like this, write code, and even insert a chunk of cod...
13739 sym R (1296 sym/5 pcs) 56 img
How to use R Markdown (part two): for learning R!
Welcome to part two of my blog series on R Markdown. In the first part, I went over how to create a basic R Markdown document and how to use R Markdown syntax. In this post, I’m going to talk about how you can use R Markdown to learn R. So why is R Markdown good for learning R? As you saw in the first post, R Markdown is a method for typing no...
8527 sym 28 img
How to use the group_by function with your ecological data
In scientific data and experiments, we often have groups of subjects between which we want to compare an observed response. For example, we might want to compare the growth rates of plants under different light treatments. Or maybe we want to compare CO² emissions of different countries over time. Each of these scenarios requires you to group yo...
6565 sym R (3265 sym/9 pcs) 2 img
How to use pipes to clean up your R code
I’ve talked a little bit about pipes (written as %>%) in a past blog post, but they’re so important in R that I thought they deserved their own post. In this tutorial, I’m going to give an explanation of what pipes are and when they can be used, and then I’m going to demonstrate how useful they can be for writing clean and neat R code. W...
6003 sym R (2793 sym/6 pcs) 6 img
Complete tutorial on using ‘apply’ functions in R
Today I’m going to talk about a useful family of functions that allows you to repetitively perform a specified function (e.g., sum(), mean()) across a vector, list, matrix, or data frame. For those of you familiar with ‘for’ loops, the apply() family often allows you to avoid constructing those and instead wrap the loop into one simple func...
11091 sym R (3922 sym/15 pcs) 2 img