diff gls-adjusted.R @ 0:b416a363a2d5 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:03:31 -0400
parents
children
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gls-adjusted.R	Thu Jun 20 04:03:31 2019 -0400
@@ -0,0 +1,16 @@
+#!/usr/bin/env Rscript
+library(nlme)
+library(MASS)
+
+args = commandArgs(trailingOnly=TRUE)
+input1 = read.table(args[1], header=TRUE) #input1=col.index =glmmpql-output
+input2 = read.table(args[2], header=TRUE,sep="	") #input2=data.index =abundance_index-output
+
+input1<-as.matrix(input1)
+
+year <- unique(input2$YEAR)
+mod <- gls(input1~year, correlation = corARMA(p=2))
+summary<-summary(mod)
+
+save(mod, file = "mod_adjusted.rda")
+capture.output(summary, file="mod_adjusted-summary.txt")