๐Ÿ—“๏ธ Session 4: Object types in R

Published

17 10 2025

Modified

20 10 2025

In the first part of this session you learn some additional details about R packages and about the most important and most fundamental object types in R, such as decimal numbers or words. While this might look a bit boring at first, understanding these basic types is fundamental for all the more advanced (and exiting) stuff in the future!

In the second part of this session, you are then introduced to two more advanced object types in R. The two object types covered, factors and data frames, are advanced in the sense that they can be thought of extensions of some of the basic object types you encountered before: factors and special kinds of integers, and data frames are special kinds of lists.

๐Ÿ‘จโ€๐Ÿซ Lecture Slides

For the slides of the first part of this session (Packages and basic object types) on click on the slide area below or click here to download the slides.

For the slides of the second part of this session (Advanced object types) see the slide area below or click here to download the slides.

๐ŸŽฅ Lecture videos

All the videos for the first part on basic object types are available via this playlist.

All the videos for the second part on advanced object types are available via this playlist.

๐Ÿ“š Mandatory Reading

Read the following tutorials for the first part on basic object types:

The topics of the second part on advanced object types are covered here:

๐Ÿ† Further readings

I suggest you read these references after you learned about data wrangling techniques in session 10.

โœ๏ธ Coursework

  • Do the ObjectTypes1 exercises of the package DataScienceExercises for the first part on basic object types:
learnr::run_tutorial(
  name = "ObjectTypes1", 
  package = "DataScienceExercises", 
  shiny_args=list("launch.browser"=TRUE))
  • For the second part do the ObjectTypes2 exercises of the package DataScienceExercises
learnr::run_tutorial(
  name = "ObjectTypes2", 
  package = "DataScienceExercises", 
  shiny_args=list("launch.browser"=TRUE))
  • If you have questions or problems, please post them in the Moodle forum

References

Wickham, H., ร‡etinkaya-Rundel, M. and Grolemund, G. (2023) R for data science: Import, tidy, transform, visualize, and model data, 2nd edition., Beijing et al.: Oโ€™Reilly, available at https://r4ds.hadley.nz/.