Importing and recoding data

Tyler George

Cornell College
DSC 223 - Spring 2024 Block 7

Reading data into R

Reading rectangular data

  • Using readr:
    • Most commonly: read_csv()
    • Maybe also: read_tsv(), read_delim(), etc.
  • Using readxl: read_excel()
  • Using googlesheets4: read_sheet()

Reading and writing CSV files

Age gap in Hollywood relationships

What is the story in this visualization?

Application exercise: ae-08-data-import

  • Go to Github and find the repo for ae-08-data-import.
  • Open the file called ae-08-data-import.qmd and render it.
  • Work on Part 1.

Reading Excel files

Sales data

Are these data tidy? Why or why not?

Sales data

What “data moves” do we need to go from the original, non-tidy data to this, tidy one?

Application exercise: ae-08-data-import

  • Go back to your project called ae.
  • If there are any uncommitted files, commit them, and push.
  • Work on Part 2 in ae-08-data-import.qmd.