8.1 - Overview of Importing Text Files

Here we'll introduce the most straighforward way to import data - basically:

  1. Open the data in a spreadsheet to clean it up:
    • Copy and paste only the data into a fresh worksheet
    • Fix column names (no spaces or special characters, and short is good)
    • Check data types - numeric variables should contain only numbers
  2. Save the data from a spreadsheet as a .csv file
  3. Import data to R using read.csv()
  4. Repeat steps 1 and 2 until step 3 works