0

我对 R 有点陌生,并且在将数据值调整为我使用 ggplot2 制作的图表时遇到了问题。

这是我用于生成绘图的代码。

sample.data <- read.csv(file = file.choose())
sample.data1 <- read.csv(file = file.choose())
sample.data <- sample.data[c(1:754),c(2,6,7,8,10,11)]
sample.data1<- sample.data1[c(1:754),c(2:7)]
sample.data.combined <- data.frame(sample.data,sample.data1)

 A <- sample.data.combined$TIMESTAMP_UTC
 B <- sample.data.combined$SENTIMENT_VOLUME_1D
 D <- sample.data.combined$Open
 E <- sample.data.combined$High
 G <- sample.data.combined$Low
 A1 <- as.Date(A,format  = "%m/%d/%y")

 library(ggplot2)


P <- ggplot(sample.data.combined,aes(A1,B,colour = "red"))+
geom_line(aes(A1, D, colour="blue"), sample.data.combined) + 
geom_line(aes(A1, E, colour="yellow"), sample.data.combined) + 
geom_line(aes(A1, G, colour="violet"), sample.data.combined) 

P + scale_y_continuous(breaks=seq(20,50,1))

我无法更清楚地了解轴以及我们可以从中读取数据的位置?

4

0 回答 0