I need some help with ggplot2. I have got some meteorological data and want to plot the time series. I've tried using a R script it worked for this type of data with light modifications. But when try to ggplot I get an error I've never seen before (not so experienced as R user).
我需要一些ggplot2的帮助。我有一些气象数据,想绘制时间序列。我尝试过使用R脚本,它可以对这种类型的数据进行轻微修改。但是当我尝试ggplot时,我得到了一个我以前从未见过的错误(没有R用户那么有经验)。
The code I'm using
我正在使用的代码
library(ggplot2)
library(zoo)
datos=read.csv("dat.txt",header=TRUE,sep=";")
fecha=as.POSIXct(datos[,1], format="%d/%m/%Y")
tmax = ggplot(data=datos,aes(x=fecha, y=TempMax)) + geom_line(colour="red")
The error I get when writing tmax
is
写tmax时得到的错误是
Error in cut.default(unclass(x), unclass(breaks), labels = labels, right = right, :
a vector of length 1317420001 could not be assigned
Data structure for dput
can be found at https://www.dropbox.com/s/rkh6db9aqdyfw7k/dputdatos.txt and original data at https://www.dropbox.com/s/ds5zp9jonznpuwb/dat.txt
有关dput的数据结构,请访问https://www.dropbox.com/s/rkh6db9aqdyfw7k/dputdatos.txt,原始数据位于https://www.dropbox.com/s/ds5zp9jonznpuwb/dat.txt
1 个解决方案
#1
1
The problem came from R and ggplot2 versions. I'm using R 2.15.0 and had to update ggplot2 to 0.9.0.
问题来自R和ggplot2版本。我正在使用R 2.15.0并且必须将ggplot2更新为0.9.0。
Now everything is running fine.
现在一切都运行良好。
Thank you all
谢谢你们
#1
1
The problem came from R and ggplot2 versions. I'm using R 2.15.0 and had to update ggplot2 to 0.9.0.
问题来自R和ggplot2版本。我正在使用R 2.15.0并且必须将ggplot2更新为0.9.0。
Now everything is running fine.
现在一切都运行良好。
Thank you all
谢谢你们