Mercurial > repos > ecology > regionalgam_plot_trend
comparison gls-adjusted.R @ 0:58ecd15e6836 draft default tip
planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/regionalgam commit ffe42225fff8992501b743ebe2c78e50fddc4a4e
| author | ecology |
|---|---|
| date | Thu, 20 Jun 2019 04:04:43 -0400 |
| parents | |
| children |
comparison
equal
deleted
inserted
replaced
| -1:000000000000 | 0:58ecd15e6836 |
|---|---|
| 1 #!/usr/bin/env Rscript | |
| 2 library(nlme) | |
| 3 library(MASS) | |
| 4 | |
| 5 args = commandArgs(trailingOnly=TRUE) | |
| 6 input1 = read.table(args[1], header=TRUE) #input1=col.index =glmmpql-output | |
| 7 input2 = read.table(args[2], header=TRUE,sep=" ") #input2=data.index =abundance_index-output | |
| 8 | |
| 9 input1<-as.matrix(input1) | |
| 10 | |
| 11 year <- unique(input2$YEAR) | |
| 12 mod <- gls(input1~year, correlation = corARMA(p=2)) | |
| 13 summary<-summary(mod) | |
| 14 | |
| 15 save(mod, file = "mod_adjusted.rda") | |
| 16 capture.output(summary, file="mod_adjusted-summary.txt") |
