### Short exercise for R. Write a script "Rex02.R" for the following task:
- Make a variable "x.vec", which is a sequence of integers ranging from 0~10
- Make a variable "y.vec", which is x.vec plus 15
- Produce summaries of "x.vec" and "y.vec", and identify their means.
- Make a data frame "all.points" by combining "x.vec" and "y.vec".
- Make a subset "three.points" by assigning your selection of any three records
within "all.points". Do it by indexing on "all.points".
- Name each column in "three.points" as "xx" and "yy", respectively.
- Produce a scatterplot for "three.points", where the x axis is for elements in "xx" and the y axis
is for elements in "yy".
- Add a line to the plot with intercept = first element in y.vec and slope = 1
Tip: check help for summary(), names(), plot() and abline().
### Show me your scripts and final plot! |