Create a variable called x
and assign the following numeric values: 5, 8, 13, 4, 21, 30, 2, 11.
Extract the fifth element of x
.
Extract the first two and the last two elements of x
.
Extract all elements of x
which are greater than 20.
Create a subset of x
containing values smaller than 5 or greater than or equal to 13.
Load and call up the built-in data set OrchardSprays
.
Create a new data frame called dat
that only contains the decrease
and the treatment
variables.
Form a subset of dat
that only contains treatment D.
Form a subset of dat
that only contains treatment D and observations where the response decrease
was larger than 30.
Form a subset of dat
that only contains treatment D and observations where the response decrease
was between 30 and 50.