library(dplyr); library(datasets)
data("JohnsonJohnson")
jjShares<-as.data.frame(JohnsonJohnson) %>% rename(Price=x) %>%
mutate(Time=time(JohnsonJohnson))
head(jjShares)
Price Time 1 0.71 1960.00 2 0.63 1960.25 3 0.85 1960.50 4 0.44 1960.75 5 0.61 1961.00 6 0.69 1961.25