How would I select all the rows associated with years 2006, 2019, and 2020 (keep rows with NA too)?
> head(all_data)
year Tt
<fct> <dbl>
1 2006 NA
2 2020 5
3 2008 18
4 2018 41
5 2020 33.5
6 2019 0.7
I tried this method, but I get an error:
mini_data <- all_data[(all_data$year==c('2020','2019','2006')),]
Warning messages:
1: In `==.default`(rand$year, c("2020", "2019", "2006")) :
longer object length is not a multiple of shorter object length
2: In is.na(e1) | is.na(e2) :
longer object length is not a multiple of shorter object length