-1

suppose I have daily time series data under variable name "prices", but im only interested in the past 100 days. How would i extract the last 100 elements from this variable?

Something equivalent to python's prices[-100:] but for R?

stavro
  • 63
  • 1
  • 4

1 Answers1

2

If it's a vector:

tail(prices, 100)
neilfws
  • 29,020
  • 5
  • 49
  • 59