How to perform a Mann-Kendall test on multiple columns?

Viewed 350

Hey all i'm pretty new to R, but i'm trying to perform a Mann-Kendall test on tree cover loss data to determine any significant trends.

My initial data frame looks somethings like this:

Data Frame

Install the "Kendall" package and attach it to current session

install.packages("Kendall")
require(Kendall)

Read the data & view it

AQloss <- read.csv(file = "Data/Location", header = TRUE)

Converts dataframe into a time-series using 1,2,3... as Time Index.

AQloss <- read.table(text = Lines, header = TRUE)
z <- read.zoo(AQloss, format = "%Y")
zz <- z
time(zz) <- seq_along(time(zz))
as.ts(zz)

Apply the Mann-Kendall test

MannKendall(zz)

I pieced this together from other questions on here and it seems to work when I only have one column (ie location) with forest loss data, but not with multiple columns of forest loss data.

Any tips would be helpful thanks!

0 Answers
Related