Skip to content

How to convert the index of get_quote and family to Date? #17

Answered by serkor1
andreltr asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @andreltr,

Thank you for the question. Below is a MWE on how convert POSIXct to Date,

Without conversion

# load BTC in
# daily intervals and 
# display results
tail(
  BTC <- cryptoQuotes::get_quote(
    ticker   = "PF_XBTUSD",
    source   = "kraken",
    interval = "1d"
  )
)
#>                      open  high   low close    volume
#> 2024-06-15 02:00:00 66015 66462 65825 66199  1743.264
#> 2024-06-16 02:00:00 66199 66957 66003 66660  1361.403
#> 2024-06-17 02:00:00 66660 67290 65075 66485  7297.915
#> 2024-06-18 02:00:00 66485 66573 64028 65150 10071.968
#> 2024-06-19 02:00:00 65150 65710 64620 64956  5108.370
#> 2024-06-20 02:00:00 64956 65640 64825 65440  1317.906

Converting to Date

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by serkor1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
help wanted Extra attention is needed question Further information is requested
2 participants