简体   繁体   中英

Mann Kendall in R

I have a temperature data set for winter months over the time period from 1980 to 2019, for which I want to run the Mann Kendall test. The excel file has one column for dates and other for temperature. I am using R's Kendall package. However, I am getting this error:

Error in Kendall(1:length(x), x): length(x)<3

As you state your problem one cannot reproduce it to see what is wrong. Reproducibility in coding problems is key for answers. The best one can do given how you stated the problem is to guess. My guess is that you have a mistake in giving x the temperature data. Since you are importing the data into R via excel you need something like this:

my_data<- read.csv("Your excel file name")
x<-my_data$Temperature
MannKendall(x)

If you provide your code I will give a better answer.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM