9 Importing External Data
Reminders: R is picky in its notation; you need to distinguish between upper/lower case. There are many ways of doing the same thing in R.
Type the code provided below in a R script to see the results. Typing is better than copying the code, as you might make a mistake in typing that allows you to learn how to debug your coding.
For any data analysis, we need data. We could manually type the data into R, but that would be time-consuming and fraught with errors. And if the data already exist in an electronic format, then why would we spend time typing?
Data come in all different formats. The data could be readable, sometimes called ascii format. Or the data could be unreadable without the original program, like an Excel workbook (*.xlsx) or other statistical software formats like Stata (*.dta) or SAS (*.sas7bdat).
As a note, RStudio continually is updating its software. Thus there may be other ways to import data.