R-Studio (R Programming Language)
- How would you create a vector
V
containing the values 0, 0.25, 0.5, 0.75, and 1?
#insert your code
- Name the elements of
V
: first, second, middle, fourth, last. Describe two ways of naming elements inV
#insert your code
- Suppose you keep track of your mileage each time you fill up. At your last 6 fill-ups the mileage was
65311 65624 65908 66219 66499 66821 67145 67447. Enter these numbers into R as vector
miles
. Use the functiondiff
on the datamiles
. What does it give? Usesum
on the computed differences to find the total travelled distance.
#insert your code