I am using the "hydroTSM" package and "trend" package to convert my daily
time series into monthly and then analyze the seasonal trend. My code is
y <-read.csv("P-GHCNDUSW00093820.csv",as.is=TRUE)
y$DATE <- as.Date(as.character(y$DATE),format="%Y%m%d")
x <- xts(y$PRCP,y$DATE)
p <- daily2monthly(x, FUN=sum, na.rm = T)
r <- as.ts(p)
SeasonalMannKendall(r)
The last line returns an error like
Error in if (x[j, g] == x[i, g]) { :
missing value where TRUE/FALSE needed
I suspect that the error is because of the format of the time series object
which may not be correct as in the attached image. It is making the monthly
sums correct however I don't know why there are so many NA values. Each
year should have only 12 values for the 12 months.
Any ideas how to fix this error?
--
*Somsubhra Chattopadhyay*
Graduate Research Assistant
Biosystems and Agricultural Engineering Department
University of Kentucky, Lexington, KY 40546
Email: [email protected]
Cell: 9198026951
______________________________________________
[email protected] mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.