ABSTRACT

This chapter deals with importing data from local or Web files into R, exporting data out of R, and alternatives to rio. The rio package has just one function to read in many different types of files: import(). rio can also import well-formatted HTML tables from Web pages, but the tables have to be extremely well-formatted. In real life, Web data rarely appears in neat, isolated form. A good option for cases that are not quite as well crafted is often the htmltab package which can be installed with install.packages("htmltab"). The most popular way to install packages from GitHub is to use a package called devtools, which includes a few ways to install packages from other places besides CRAN. The aptly named weatherdata package on CRAN can pull data from the Weather Underground API, which has information for many countries around the world. Dealing with “untidy” data can, unfortunately, get pretty complicated.