Write a R program to create a vector using : operator and seq() function.
x = 1:15 print("New vector using : operator-") print(x) print("New vector using seq() function-") print("Specify step size:") y = seq(1, 3, by=0.3) print(y) print("Specify length of the vector:") z = seq(1, 5, length.out = 6) print(z)
Sample Output:
[1] "New vector using : operator-" [1] 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 [1] "New vector using seq() function-" [1] "Specify step size:" [1] 1.0 1.3 1.6 1.9 2.2 2.5 2.8 [1] "Specify length of the vector:" [1] 1.0 1.8 2.6 3.4 4.2 5.0
total answers (1)
start bookmarking useful questions and collections and save it into your own study-lists, login now to start creating your own collections.
Sample Output:
need an explanation for this answer? contact us directly to get an explanation for this answer