| index | R Documentation |
Return index variable from a tsibble
index(x)
index_var(x)
index2(x)
index2_var(x)
x |
A tsibble object. |
index() returns a symbol; index_var() gives a character string.
When used inside tidyverse functions like dplyr::select(), dplyr::relocate(),
or other tidyselect-compatible functions, index_var() acts as a selection
helper that automatically selects the index column from the tsibble.
index(pedestrian)
index_var(pedestrian)
# Use as a tidyselect helper
library(dplyr)
tourism %>% select(index_var(), key_vars())
# Use with relocate
tourism %>% relocate(index_var(), .after = key_vars())
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.