Mercurial > repos > ecology > vigiechiro_idcorrect_2ndlayer
comparison Id_Tidy.R @ 1:f3fc8d243b1a draft default tip
planemo upload for repository https://github.com/galaxyecology/tools-ecology/tools/vigiechiro commit 7ef0e58cbcbf41088e359f00b6c86504c773c271
author | ecology |
---|---|
date | Fri, 26 Apr 2019 12:20:52 -0400 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
0:6681b6ba1d7e | 1:f3fc8d243b1a |
---|---|
1 suppressMessages(library(data.table)) | |
2 | |
3 args <- commandArgs(trailingOnly = TRUE) | |
4 #print(args) | |
5 filename=args[2] | |
6 | |
7 DataPar=fread(args[1]) #ids | |
8 DataPar$participation=substr(filename,nchar(filename)-40,nchar(filename)-17) | |
9 #DataPar$participation=substr(args[1],nchar(args[1])-40,nchar(args[1])-17) | |
10 test1=duplicated(cbind(DataPar$'nom du fichier',DataPar$tadarida_taxon)) | |
11 test2=(DataPar$tadarida_taxon=="empty") | |
12 DataPar=subset(DataPar,(!test1)|(test2)) | |
13 DataPar$tadarida_probabilite[DataPar$tadarida_probabilite==""]="0" | |
14 DataPar$tadarida_probabilite=as.numeric(DataPar$tadarida_probabilite) | |
15 | |
16 #write.table(DataPar,paste0(substr(args[1],nchar(args[1])-40,nchar(args[1])-17),"-DataCorrC2.csv"),row.names=F,sep="\t") | |
17 write.table(DataPar,"Id_tidy.tabular",row.names=F,sep="\t") |