我想在一张图中比较两个数据集(以太坊价格和交易量)。我画了一个图,但我认为y轴的比例有些错误:
ETH_price <- read.table(file = '~/R/export-EtherPrice.csv',header = T,sep=";")
transaction_volume <- read.csv(file = '~/R/export-TxGrowth.csv',sep=";")
head(ETH_price)
head(transaction_volume)
ETH_price$Date.UTC. <- as.Date(ETH_price$Date.UTC.,format = "%m/%d/%Y")
str(ETH_price) # verify the date format
transaction_volume$Date.UTC. <- as.Date(transaction_volume$Date.UTC.,format = "%m/%d/%Y")
str(transaction_volume) # verify the date format
ggplot(ETH_price,aes(x = Date.UTC.,y = Value)) +
geom_point()+
geom_line(aes(color="ETH_price")) +
geom_line(data=transaction_volume,y = Value,color="transaction_volume")) +
labs(color="Legend") +
scale_colour_manual("",breaks = c("ETH_price","transaction_volume"),values = c("blue","brown")) +
ggtitle("Correlation of ETH price and transaction volume") +
theme(plot.title = element_text(lineheight=.7,face="bold"))
发生以下错误:
Error in seq.int(0,to0 - from,by) : 'to' must be a finite number
数据看起来像这样(ETH_price):
> head(transaction_volume)
Date.UTC. UnixTimeStamp Value
1 03.03.2017 1488499200 64294
2 04.03.2017 1488585600 58756
3 05.03.2017 1488672000 57031
4 06.03.2017 1488758400 57020
5 07.03.2017 1488844800 62589
6 08.03.2017 1488931200 55386
情节看起来像这样:
有人知道什么地方可能出问题了吗?
我对每个提示都很满意!:)
MAiniak
/代码已更新