First Things Second

Look closer at data types and object types before focusing on the most important features of programming languages, namely operators and control structures.

Learning objectives

At the end of this unit you should be able to

  • distinguish data types from data structures and select elements by index;
  • use comparisons and logical operators in conditional statements;
  • use loops to repeat an operation;
  • define and call a small function and explain its returned value;
  • use lapply() to collect results in a list and flatten a suitable list into a vector.

Preparation for the assignment

Follow the pages on data types, object types and indexing, then complete the required preparation on operations. This prepares you for Assignment 02 and for the reusable cleaning functions in Unit 04.

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: