Q:

Write a R program to create a vector and find the length and the dimension of the vector

0

Write a R program to create a vector and find the length and the dimension of the vector.

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

v = c(1,3,5,7,9)
print("Original vectors:")
print(v)
print("Dimension of the vector:")
print(dim(v))
print("length of the vector:")
print(length(v))

Sample Output:

[1] "Original vectors:"
[1] 1 3 5 7 9
[1] "Dimension of the vector:"
NULL
[1] "length of the vector:"
[1] 5

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

Similar questions


need a help?


find thousands of online teachers now