Introduction to data types and objects

You will learn about different types of data storing in objects.

Data types are used within type systems, which offer various ways of defining, implementing and using them. Different type systems ensure varying degrees of type safety. Almost all programming languages explicitly include the notion of data type, though different languages may use different terminology.

In computer science, type safety is the extent to which a programming language discourages or prevents type errors. A type error is erroneous or undesirable program behaviour caused by a discrepancy between differing data types for the program’s constants, variables, and methods (functions), e.g., treating an integer (int) as a floating-point number (float).

At the end of this unit you should know

  • what integer, character, string, float, boolean and NULL/NA mean
  • the differences between the data types mentioned above
  • what variables, arrays, matrices, data frames and lists are
  • and how the data types are stored in them


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.