情节奇怪的原因

roc*_*wap -4 plot r time-series

我有深度与时间的关系: 这个情节在5月初有一个奇怪的差距.

在此输入图像描述

我检查了数据,但没有NAs或Nans或没有丢失的数据.这是15分钟的定期间隔的时间序列

我不能在这里给出数据集,因为它包含10,000行.有人可以提出可能的建议吗?

我使用以下绘图代码:

   library(zoo)
   z=read.zoo("data.txt", header=TRUE)
   temp=index(z[,1])
   m=coredata(z[,1])
x=0.001
p=rep.int(x,length(temp))
png(filename=paste(Name[k],"_mean1.png", sep=''), width= 3500, height=1600, units="px")
par(mar=c(13,13,5,3),cex.axis= 2.5, cex.lab=3, cex.main=3.5, cex.sub=5)
plot(temp,m, xlab="Time", ylab="Depth",type='l', main=Name[k])
symbols(temp,m,add=TRUE,circles=p, inches=1/15, ann=F, bg="steelblue2", fg=NULL)
dev.off()
Run Code Online (Sandbox Code Playgroud)

the*_*ail 7

好的,这是对您发布的内容的猜测.

我猜测在5月初的一段时间内没有数据会突然出现"差距".没有NA,因为这个时期根本没有任何数据行.通过这一行代码绘制的图中仍有一条细黑线,它将数据中的"间隙"联系起来......

plot(temp,m, xlab="Time", ylab="Depth",type='l', main=Name[k])
Run Code Online (Sandbox Code Playgroud)

...但是没有蓝色符号(圆圈)紧密地绘制在一起,使其看起来像一条连续的蓝线.使用以下代码绘制蓝色符号,位于现有绘图的顶部:

symbols(temp,m,add=TRUE,circles=p, inches=1/15, ann=F, bg="steelblue2", fg=NULL)
Run Code Online (Sandbox Code Playgroud)

我建议不要绘制一条线,然后在它的顶部绘制符号,你只需绘制一条粗蓝线就像:

plot(temp,m, xlab="Time", ylab="Depth",type='l', main=Name[k],lwd=5,col="steelblue2")
Run Code Online (Sandbox Code Playgroud)