How do I retrieve data for a specific date in r?

Viewed 33

Let's say if I want to retrieve the closing price for a cryptocurrency on 2022-09-01. I am sure my code is not correct.

BTC.todays_price <- BTC.charts$close %>% filter(BTC.charts$date = '2022-09-01')

Thanks in advance!

1 Answers

Try the following to conditionally select:

BTC.charts[BTC.charts$date == '2022-09-01', ]$close
Related