Backticks in R

The only times I used backticks in R was when a file was imported into R and the column names had spaces (as a side note, please don’t use spaces in your column or file names but use an underscore, i.e. _). For example, you can access col a by using backticks. my_df <- data.frame(…

Continue Reading

Wrapping R vectors with parentheses

In this vectors and lists tutorial, the example code wraps the R vector assignments with parentheses or round brackets. (v_log <- c(TRUE, FALSE, FALSE, TRUE)) #> [1] TRUE FALSE FALSE TRUE (v_int <- 1:4) #> [1] 1 2 3 4 (v_doub <- 1:4 * 1.2) #> [1] 1.2 2.4 3.6 4.8 (v_char <- letters[1:4]) #>…

Continue Reading

Double square brackets in R

This deserved its own post because I had some difficulty understanding the double square brackets in R. If we search for “double square brackets in R” we come across this tutorial, which shows us that the double square brackets, i.e. [[]], can be used to directly access columns:

Continue Reading