Creating vectors and tables

1 Lecture

Slides in full screen

2 Exercise 1

2.1 Background

Imagine you want to conduct an experiment on the effects of two nutrients - nitrogen (N) and phosphorus (P) - in combination with and without irrigation on the yield of oat.

The levels for the experimental treatments are:

  • Nitrogen (N) in kg per ha: 100, 200, 300, 400
  • Phosphorus (P) in kg per ha: 50, 100, 150
  • Irrigation: yes, no

The experiment should be full-factorial that means it should include all possible combinations of all treatments levels.

2.2 Questions and tasks

  1. How many possible combinations of treatment levels does this full factorial experiment include?
  2. Create a table with three columns: nitrogen, phosphorus, and irrigation, and as many rows as there are treatment level combinations using the functions you just learned.

Extra: Solve task 2 with a single function call to a function that we did not cover so far.

Solution for exercise 1