Introduction to data input and output

You will learn how to import, inspect and export tabular data, and preserve R objects in files.

Before you start: selecting table columns; project folders and relative paths.
Setup: Keep input files in Data/ and practice outputs in Output/, relative to your project root.
Your check: Choose import/export checks before using a table for analysis. Practise in the unit summary.

At the end of this unit, you should be able to

  • recognize tabular data and choose separators, decimal marks and headers for a CSV import,
  • import a table, inspect its column types and missing values, and export it again,
  • save and restore an R object with RDS files,
  • follow an import workflow with the supplied official land-use data, and
  • describe how a loop can repeat a file operation across an input folder.

Use the object and indexing skills from Units 02–04 and the working directories and paths from Unit 05. The final batch-processing lesson previews a for-loop from Unit 07; you can return to it after that unit.

Comments?

You can leave comments below if you have questions or remarks about any of the text or code in this unit. Please copy the corresponding line into your comment to make it easier to answer your question.

Updated: