for (i in (3:1))
{
n = 1:10
an<-i+(n-1)
}
With the above, you cannot create more than one sequence.
Please tell me how to make the first, second, and third sequences at once.
I look forward to your kind cooperation.
library(purrrr)
map(1:3, `+`, 1:10)
[[1]]
[1] 2 3 4 5 6 7 8 9 10 11
[[2]]
[1] 3 4 5 6 7 8 9 10 11 12
[[3]]
[1] 4 5 6 7 8 9 10 11 12 13
© 2024 OneMinuteCode. All rights reserved.