You have to store your data as a Time-Series (ts), first.?To define a column of data as ts, you may use this:
library(timeSeries)Nile <- read.csv(file.choose(), header=F)#If your data is monthly, you may define the frequency as 12, for annual ts set freq. as 1.
#If your data starts from for e.g., 1990, then:NileTS <- ts(Nile, frequency=1, start=c(1990,1))#To plot the time seriesplot.ts(NileTS)
On Saturday, June 18, 2016 3:47 AM, lily li wrote:
Dear R users,
Can anyone help me with mann-kendall trend test? I tried to use the newest
packages 'trend', and the function mk.test, but had problems in applying
the input data.
For example, res <- mk.test(Nile), Nile is a time-series data. But when I
use my dataset, with one column which is a time-series data, it says
"error: input must be ts object". How to do this? Thanks for your help.
??? [[alternative HTML version deleted]]
R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, seehttps://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.
[[alternative HTML version deleted]]