comparison ab-index.R @ 0:f3e1b6d244a6 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:57 -0400
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:f3e1b6d244a6
1 #!/usr/bin/env Rscript
2
3 args = commandArgs(trailingOnly=TRUE)
4 source(args[1])
5
6
7 tryCatch({input = read.table(args[2], header=TRUE,sep=" ")},finally={input = read.table(args[2], header=TRUE,sep=",")})
8 pheno = read.table(args[3], header=TRUE,sep=" ")
9
10 if("TREND" %in% colnames(input)){
11 input <- input[input$TREND==1,c("SPECIES","SITE","YEAR","MONTH","DAY","COUNT")]
12 }
13 data.index <- abundance_index(input, pheno)
14 write.table(data.index, file="data.index", row.names=FALSE, sep=" ")