Michael, Cheers for the input - still learning "syntax" as I go - very new to the use of programming language and having to self teach as part of my PhD.
The input data was fine - it was the call on the R website which was confusing me - by defining the location of the actual data in the second column and calling "result <- MannKendall(filename[,2])", it worked without issue. Cheers again though, Scott McGrane MA (Hons), MRes SAGES Theme 1 PhD Student Northern Rivers Institute St Mary's Building University of Aberdeen http://www.abdn.ac.uk/nri ________________________________________ From: R. Michael Weylandt <michael.weyla...@gmail.com> [via R] [ml-node+3786437-1846790326-252...@n4.nabble.com] Sent: 02 September 2011 04:47 PM To: Mcgrane, Scott Subject: Re: Mann Kendall Test for Trend I don't have the Kendall package at my fingers, but it seems like you have some deeper trouble with R syntax if you are writing things like MannKendall(1:27(data),data) when you know that MannKendall only takes one argument. Can you verify that your data object actually has a full set of data to it? (use some combination of length(),nrow(),dput(),head(),tail() etc) For a general tip, data() is a function to R so its not the best idea for an object name. Outside chance that might be what's causing your problem. Michael Weylandt On Fri, Sep 2, 2011 at 11:35 AM, ScottM <[hidden email]</user/SendEmail.jtp?type=node&node=3786437&i=0>> wrote: > Hi there, > > I'm trying to apply the Mann Kendall test for trend analysis of a time > series. I have downloaded and installed the package Kendall and > subsequently loaded it into the software. > > My time series is a .txt file with 2 columns - column 1 is the year (1985 - > 2009) and column 2 is the corresponding entry variable. > > According to the R guidelines, the call should be: > > MannKendall(x) [whereby x is a data vector, usually a time series] > > As such, I've loaded in my file 'data.txt' and then called on: > > MannKendall(data), to which I get the following: > > Error in Kendall(1:length(x), x) : length(x)<3 > > What do I need to do to get beyond this highly annoying error? I've tried > MannKendall(1:27(data), data), but then keep getting this: > > Error in Kendall(1:length(x), x) : attempt to apply non-function > > Any help greatly received! > > S > > -- > View this message in context: > http://r.789695.n4.nabble.com/Mann-Kendall-Test-for-Trend-tp3786392p3786392.html > Sent from the R help mailing list archive at Nabble.com. > > ______________________________________________ > [hidden email]</user/SendEmail.jtp?type=node&node=3786437&i=1> mailing list > 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. > [[alternative HTML version deleted]] ______________________________________________ [hidden email]</user/SendEmail.jtp?type=node&node=3786437&i=2> mailing list 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. ________________________________ If you reply to this email, your message will be added to the discussion below: http://r.789695.n4.nabble.com/Mann-Kendall-Test-for-Trend-tp3786392p3786437.html To unsubscribe from Mann Kendall Test for Trend, click here<http://r.789695.n4.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=3786392&code=c2NvdHQubWNncmFuZUBhYmRuLmFjLnVrfDM3ODYzOTJ8OTM1MjEwNDY5>. The University of Aberdeen is a charity registered in Scotland, No SC013683. -- View this message in context: http://r.789695.n4.nabble.com/Mann-Kendall-Test-for-Trend-tp3786392p3786488.html Sent from the R help mailing list archive at Nabble.com. [[alternative HTML version deleted]] ______________________________________________ R-help@r-project.org mailing list 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.