Here we'll introduce the most straighforward way to import data - basically:
- 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
- Save the data from a spreadsheet as a .csv file
- Import data to R using
read.csv()
- Repeat steps 1 and 2 until step 3 works