[R] need help with a time series plotting problem

David Winsemius dwinsemius at comcast.net
Sat Dec 24 18:26:09 CET 2011


On Dec 24, 2011, at 9:24 AM, vibhava wrote:

> thanks for the reply. here is subset of the data that i want to plot:
> 	date	usgs700	
> 1	10/1/2000	0.050970325			
> 2	10/2/2000	0.041059428			
> 3	10/3/2000	0.032564374			
> 4	10/4/2000	0.02775051
> .
> .

Instead of posting print-output why not post the results of  
dput(head(flow))

> > further  useless output deleted.

>
> my script again is:
>
> setwd("J:/Rstuff/flow")
> flow=read.delim("flow.dat",header=TRUE,sep="\t")
> plot(flow$usgs1500

There's no column with that name.

> ~as.Date(flow$date,
> "%m/%d/%y")

For another thing, you generally  need to use %Y for 4 digit years.

> ,type="l",xlab="date",ylab="daily discharge (m3/s)
> ",main="USGS1500",yaxs="i", xaxs="i",)

Not sure if that empty argument is going to be handled gracefully.

> i wish to plot all this data as a single time series but my program  
> is doing
> some weird stuff and the x-axis has labels Jan-dec and the long term  
> series
> is broken and plotted on yearly basis.

Your code is not reproducible.


-- 
David Winsemius, MD
West Hartford, CT



More information about the R-help mailing list