我是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))
我在使轴更清晰方面遇到麻烦,我们也可以从中读取数据?