How do I generate a vector with a specified increment step (e.g. 2)? For example, how do I produce the following
0 2 4 6 8 10
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Executing
seq(1, 10, 1)does what1:10does. You can change the last parameter ofseq, i.e.by, to be the step of whatever size you like.