joshuaulrich / joshuaulrich/quantmod
getPrice drops dims when used on non-xts objects
- Dominant language
- R
- Stars
- 906
- Forks
- 233
- PR merge metrics
- No merged PRs in 30d
Description
`getPrice` will drops dims when it returns a single column for non-xts objects. For example:
``` r
R> require(quantmod)
R> data(sample_matrix)
R> head(getPrice(sample_matrix, prefer = "Close"))
2007-01-02 2007-01-03 2007-01-04 2007-01-05 2007-01-06 2007-01-07
50.11778 50.39767 50.33236 50.33459 50.18112 49.99185
R> head(getPrice(as.data.frame(sample_matrix), prefer = "Close"))
[1] 50.11778 50.39767 50.33236 50.33459 50.18112 49.99185
R> head(getPrice(as.xts(sample_matrix), prefer = "Close"))
Close
2007-01-02 50.11778
2007-01-03 50.39767
2007-01-04 50.33236
2007-01-05 50.33459
2007-01-06 50.18112
2007-01-07 49.99185
```
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.