Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
183 views
in Technique[技术] by (71.8m points)

r - How to generate a vector containing a numeric sequence with a given step?

I have a decimal variable x0.

I want to make a vector from [x0, 6] increasing by 0.01 each time.

I know it's something like c(x0:6, by=0.01) but that didn't work.

question from:https://stackoverflow.com/questions/7133413/how-to-generate-a-vector-containing-a-numeric-sequence-with-a-given-step

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
x0 = 5.9
seq(x0, 6, 0.01)
 [1] 5.90 5.91 5.92 5.93 5.94 5.95 5.96 5.97 5.98 5.99 6.00

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...