简体   繁体   English

如何检索 r 中特定日期的数据?

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

Let's say if I want to retrieve the closing price for a cryptocurrency on 2022-09-01.假设我想检索一种加密货币在 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!提前致谢!

Try the following to conditionally select:尝试以下有条件的 select:

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM