How to create fixed length between two values in R

r

#1

Hello, while studying about the sequencing of vector I am facing a problem in creating a vector of fixed length between two value
for example I want a sequence between 5 and 10 of length 20 but I am not able to perform it


#2

The following should work:

seq(5,10,length.out=21)
[1] 5.00 5.25 5.50 5.75 6.00 6.25 6.50 6.75 7.00 7.25 7.50 7.75 8.00 8.25 8.50 8.75 9.00 9.25 9.50 9.75 10.00

You can use the length.out to be 20 or 21 as required. Hope it helps!