Serijoscha
Serijoscha

Reputation: 53

R: Create a Vector starting at position 0 in R

I am new to R. I want to carry out a simulation starting at Period 0. That works quite well using vectors, but they all start at position 1. Is there a way to change that? Or an alternative?

Thanks a lot! Serijoscha

Upvotes: 1

Views: 1190

Answers (1)

Jeff
Jeff

Reputation: 738

Use the Oarray package with offset = 0

library(Oarray)
vec <- Oarray(1:10, offset = 0)
vec[0]
#[1] 1

Upvotes: 2

Related Questions