if (!file.exists("ames-liquor.rds")) {
url <- "https://github.com/ds202-at-ISU/materials/blob/master/03_tidyverse/data/ames-liquor.rds?raw=TRUE"
download.file(url, "ames-liquor.rds", mode="wb")
}
data <- readRDS("ames-liquor.rds")
I am so confused on how to get *how many observations are in data? *how many different cities are in the data? (Variable City, careful, trick question!) *different stores: how many different stores are in the data? Check first with Store Name, then with Store Number. Discuss differences (give an example), and then answer the question of how many different stores are in the data set.
And the data cleaning part of it
how to extract geographic latitude and longitude from the variable Store Location
how to check variable types. Pick five variables that need to be converted to a different type and fix those.
how to use the package lubridate to convert the Date variable to a date. Then extract year, month and day from the variable Date
Homework inspired questions are welcome here, but you have to tell us what have you tried so far? what is your specific problem? We are more inclined towards helping you with specific coding problems rather than doing your work for you.
For guidelines about how to properly ask homework related questions here, please read our homework policy.
You might want to have a look at some functions. Since your downloaded data comes from somewhat tidyverse related, you will stick to the tidyverse I guess. For your first tasks, you should read about nrow() and dplyr::n_distinct() as well as unique(). Those are likely the minimum set of functions you are supposed to use to answer those questions.
Your second part is about working with geographical data - which can be done i.e. with the sf package (see here). To check variable types you can use str() and coerce incorrectly specified data with the large amount of as.*** functions. And some advice regarding the lubridate package can be found here.
Good luck on your exams and feel free to ask further questions, if you tried something and come to a point where you need help regarding the code.
Kind regards