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.
- Tabulated Data I/O: understand text files, data frames and saved R objects.
- Organize Your Data Files: download a small practice file and locate it inside your project.
- R Syntax and Help: read the practice file and connect function syntax with the help page.
- Example: CSV I/O: import, inspect and prepare the official land-use data, then save the result.
- Visualization: choose plots for different questions and try small examples.
- Example: Visual Data Exploration: explore the prepared land-use data and arrange plots in a four-panel figure.
- 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 intoData/. - 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:
pressureandOrangeare included with R. - Marked assignment: obtain
hessen_holzeinschlag_2003-2025.csvfrom 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.