R简单的绘图问题

时间:2015-03-25 19:40:47

标签: r

enter image description here我试图用RSudio在R of Roll中绘制一条线图。 X和Y值是正确的,但整个图表是黑色

mru <- read.csv("E:/r-train/mru.txt", header = TRUE, sep = ",")
attach(mru)
plot( time, p1)

Time,r1,p1,h1,r2,p2,h2,r3,p3,h3
14:07:32,-0.08,0.41,0,-0.45,0.8145,1.4436,0.46,-0.06,0
14:07:33,-0.07,0.41,0,-0.459,0.8001,1.4436,0.46,-0.06,0

我还尝试格式化时间mru <- read.csv("E/r-train/mru.txt", header = TRUE, sep = ",", format='%H:%M:%S')并得到相同的结果。

还尝试了这个:它没有用

mru <- read.csv("E:/r-train/mru.txt", header = TRUE, sep = ",", as.is = TRUE)
mru[,1] <- as.POSIXct(strptime(mru[,1],"%H:%M:%S"))
plot(Time, h1)

因为它这样做:

 $ Time: POSIXct, format: "2015-03-26 14:07:00" "2015-03-26 14:07:00" "2015-03-26 14:07:00" "2015-03-26 14:07:00" ...
 $ r1  : chr  "-0.08" "-0.07" "-0.07" "-0.07" ...

0 个答案:

没有答案