Q:

Write a R program to create a vector which contains 10 random integer values between -50 and +50

0

Write a R program to create a vector which contains 10 random integer values between -50 and +50.

All Answers

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

v = sample(-50:50, 10, replace=TRUE)
print("Content of the vector:")
print("10 random integer values between -50 and +50:")
print(v)

Sample Output:

[1] "Content of the vector:"
[1] "10 random integer values between -50 and +50:"
 [1]  31 -13 -21  42  49 -39  20  12  39  -2

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