代码
> head(splitan)
open high low close volume value
2013-07-11 153.62 154.44 154.44 154.44 0 0
2013-07-12 154.44 156.51 156.51 156.51 0 0
2013-07-15 157.29 157.29 157.29 157.29 0 0
2013-07-16 157.29 157.17 157.17 157.17 0 0
2013-07-17 157.17 156.96 156.96 156.96 0 0
2013-07-18 156.96 157.01 157.01 157.01 0 0
> head(splitan %>% ggplot2::fortify() %>% mutate(Index = as.Date(Index, format = '%Y-%m-%d')))
Index open high low close volume value
1 2013-07-10 153.62 154.44 154.44 154.44 0 0
2 2013-07-11 154.44 156.51 156.51 156.51 0 0
3 2013-07-14 157.29 157.29 157.29 157.29 0 0
4 2013-07-15 157.29 157.17 157.17 157.17 0 0
5 2013-07-16 157.17 156.96 156.96 156.96 0 0
6 2013-07-17 156.96 157.01 157.01 157.01 0 0
> str(splitan)
An ‘xts’ object on 2013-07-11/2015-12-04 containing:
Data: num [1:626, 1:6] 154 154 157 157 157 ...
- attr(*, "dimnames")=List of 2
..$ : NULL
..$ : chr [1:6] "open" "high" "low" "close" ...
Indexed by objects of class: [POSIXct,POSIXt] TZ:
Original class: 'data.frame'
xts Attributes:
List of 1
$ .RECLASS: logi TRUE