dest == "PHX")
principle: logical indexing like a = c(1,6,2,4) a[c(2,3)] a[c(F, T, T, F)]
dest == "PHX")
principle: logical indexing like a = c(1,6,2,4) a[c(2,3)] a[c(F, T, T, F)]
We can often skip the use of & and just separate our conditions with a comma.
this is specific to dplyr. not applying to general R
origin == "JFK" & (dest == "BTV" | dest == "SEA") & month >= 10
any statement that can lead to true/false is ok
2.8.3 Two categorical variables
skip; try on your own
2.5.2 Adjusting the bins
skip; try on your own
2.3.2 Overplotting
skip - try this your own!
what are the center and spread of the values, as we go across the levels of a different categorical variable.
e.g. histogram of wages for each city
Lastly, the $ operator allows us to extract and then explore a single variable within a data frame.
One of the most basic command in R. It does not require any package.
Using the View() function, which brings up RStudio’s built-in data viewer.
We may not use RStudio. Instead, try head(flights).
Another point of confusion with many new R users is the idea of an R package
It's like a python library, or, chrome extension.
Take the “copy, paste, and tweak” approach
Most recommended: copy and paste BY HAND!!!!
Warnings
e.g. try log(-1)
Errors
e.g. try 1 + "a"
nsion in Chrome (1 and 2
test