Look at Your Data

Become familiar with reading and writing data, computing summary statistics, and exploring data visually as the basics of data analysis.

Learning objectives

At the end of this unit you should be able to

  • organize local data files and use paths relative to your RStudio project,
  • read a function call and use its help page to choose arguments,
  • import and export tabulated data while checking types, identifiers, and units,
  • explain how a prepared RDS file relates to its source data,
  • compute and interpret basic summary statistics,
  • choose and justify a plot for a distribution, category comparison, time course, or relationship.

Additional material is available in the accompanying Base R course, particularly data input/output and simple visualizations.

How this unit is organized

This unit builds on the R Markdown workflow from Unit 01 and the data types and indexing from Unit 02.

We complete data I/O before moving on to visualization. In each part, start with the general explanation and small examples, then apply them to a real dataset.

  1. Tabulated Data I/O: understand text files, data frames and saved R objects.
  2. Organize Your Data Files: download a small practice file and locate it inside your project.
  3. R Syntax and Help: read the practice file and connect function syntax with the help page.
  4. Example: CSV I/O: import, inspect and prepare the official land-use data, then save the result.
  5. Visualization: choose plots for different questions and try small examples.
  6. Example: Visual Data Exploration: explore the prepared land-use data and arrange plots in a four-panel figure.
  7. Marked Assignment: Read and Plot: apply the workflow independently to timber harvest data.

Data files (reference)

Download files when you reach the relevant page, keeping their original names:

  • Syntax practice: the file-organization page provides example.txt, a small invented table that you download into Data/.
  • Land-use example: the CSV I/O page links the English teaching CSV derived from Destatis 2024 and its original workbook, dictionary and source notes. It shows how to create the prepared RDS used in visual exploration; a prepared download and preparation script are also available there.
  • Plotting practice: pressure and Orange are included with R.
  • Marked assignment: obtain hessen_holzeinschlag_2003-2025.csv from ILIAS. Assignment 03 explains its groups, units, file layout and official sources, including the Destatis quality report (PDF, German). Assignment 08 reuses this file.
  • Later units: cleaning and regression use separate regional datasets. Consult the Unit 04 file guide for their filenames and category definitions.

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: