comparison ab_index.R @ 0:5b126f770671 draft

Uploaded
author mnhn65mo
date Fri, 03 Aug 2018 08:28:22 -0400
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:5b126f770671
1 #!/usr/bin/env Rscript
2 #library("getopt")
3 #library(devtools)
4 #library(RegionalGAM)
5
6 args = commandArgs(trailingOnly=TRUE)
7 source(args[1])
8
9
10 tryCatch({input = read.table(args[2], header=TRUE,sep=" ")},finally={input = read.table(args[2], header=TRUE,sep=",")})
11 pheno = read.table(args[3], header=TRUE,sep=" ")
12
13 if("TREND" %in% colnames(input)){
14 input <- input[input$TREND==1,c("SPECIES","SITE","YEAR","MONTH","DAY","COUNT")]
15 }
16 data.index <- abundance_index(input, pheno)
17 write.table(data.index, file="data.index", row.names=FALSE, sep=" ")