Mercurial > repos > ecology > regionalgam_plot_trend
comparison glmmpql.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 input = read.table(args[1], header=TRUE,sep=" ") | |
7 glmm.mod_fullyear <- glmmPQL(regional_gam~ as.factor(YEAR)-1,data=input,family=quasipoisson,random=~1|SITE, correlation = corAR1(form = ~ YEAR | SITE),verbose = FALSE) | |
8 | |
9 col.index <- as.numeric(glmm.mod_fullyear$coefficients$fixed) | |
10 year <- unique(input$YEAR) | |
11 | |
12 write.table(col.index, file="output-glmmpql", row.names=FALSE, sep=" ") | |
13 | |
14 png('output-plot.png') | |
15 plot(year,col.index,type='o', xlab="year",ylab="collated index") | |
16 invisible(dev.off()) |