Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- head(master_1)
- S_1
- 2010-03-03 00:00:00 2.8520
- 2010-03-03 00:30:00 2.6945
- 2010-03-03 01:00:00 2.5685
- 2010-03-03 01:30:00 2.3800
- 2010-03-03 02:00:00 2.2225
- 2010-03-03 02:30:00 2.0650
- str(master_1)
- An ‘xts’ object from 2010-03-03 to 2010-05-25 08:30:00 containing:
- Data: num [1:4000, 1] 2.85 2.69 2.57 2.38 2.22 ...
- - attr(*, "dimnames")=List of 2
- ..$ : NULL
- ..$ : chr "S_1"
- Indexed by objects of class: [POSIXt,POSIXct] TZ:
- Original class: 'zoo'
- xts Attributes:
- List of 1
- $ dateFormat: chr "Date"
- head(test1)
- S_1
- 2010-03-03 00:00:00 2.8520
- 2010-03-03 00:30:00 2.6945
- 2010-03-03 01:00:00 2.5685
- 2010-03-03 01:30:00 2.3800
- 2010-03-03 02:00:00 2.2225
- 2010-03-03 02:30:00 2.0650
- str(test1)
- 'data.frame': 4000 obs. of 1 variable:
- $ S_1: num 2.85 2.69 2.57 2.38 2.22 ...
- data.frame(date=index(master_1), coredata(master_1))
- library(xts)
- set.seed(1) # for reproducible example
- master_1 <- xts(rnorm(10,mean=2,sd=0.1),as.POSIXct("2010-03-03")+30*(0:9))
- library(ggplot2)
- df <- fortify(master_1)
- head(df)
- # Index master_1
- # 1 2010-03-03 00:00:00 1.937355
- # 2 2010-03-03 00:00:30 2.018364
- # 3 2010-03-03 00:01:00 1.916437
- # 4 2010-03-03 00:01:30 2.159528
- # 5 2010-03-03 00:02:00 2.032951
- # 6 2010-03-03 00:02:30 1.917953
- as.data.table(master_1)
- library(xts)
- example(xts)
- x = head(sample.xts)
- datefield = index(x)
- newdf = data.frame(x,datefield)
- myDF <- as.data.frame(as.matrix(myXTS))
Add Comment
Please, Sign In to add comment