| Data file type | Package | Function | Can load compressed files? | Can load files from URL? |
|---|---|---|---|---|
Comma-separated values ( |
|
yes |
yes |
|
Fixed-width files (usually |
yes |
yes |
||
GeoJSON ( |
no |
yes |
||
GeoPackage ( |
no |
yes |
||
Google Sheets |
n/a |
yes |
||
HTML ( |
|
n/a |
yes |
|
JSON ( |
|
yes |
yes |
|
Microsoft Excel ( |
no |
no |
||
OpenDocument Spreadsheet ( |
|
no |
yes |
|
R Data ( |
n/a |
yes |
||
SAS ( |
yes |
yes |
||
Shapefile ( |
no |
no |
||
SPSS Statistics ( |
yes |
yes |
||
Stata ( |
yes |
yes |
||
Tab-separated values ( |
yes |
yes |
||
XML (usually |
yes |
yes |
Appendix A — Functions for reading data into R
R can read data in many different formats. Different functions (often from different packages) are needed to read files of different formats. These are some of the functions needed to read common types of file used in data analysis, including spatial data formats.