Here we'll continue our exploration of typical errors in the data import process.
read.table()can also import data from ftp and http servers, but (sadly) not from https servers.
- The "Import Dataset" icon in the "Environment" tab in RStudio - there is a nice tool here that lets you choose a file and set it up for import - it even writes the line of code into the console, so you can copy it to your editor. Note that this tool uses
read_table()(from the package "readr") and not
read.table(). In general, this is not a problem (and is even better for extremely large data sets) as long as you remember that
read_table()does not automatically convert strings to factors (like
read.table()does). This means that you need to either:
- Convert your factors manually after import
- Specify data type for those columns as "factor" in the GUI
- Copy the code into the editor and modify it to use