Mercurial > repos > ecology > tool_anonymization
annotate functions.r @ 0:c586703ea141 draft default tip
"planemo upload for repository https://github.com/Marie59/Data_explo_tools commit 60627aba07951226c8fd6bb3115be4bd118edd4e"
| author | ecology |
|---|---|
| date | Fri, 13 Aug 2021 18:13:54 +0000 |
| parents | |
| children |
| rev | line source |
|---|---|
|
0
c586703ea141
"planemo upload for repository https://github.com/Marie59/Data_explo_tools commit 60627aba07951226c8fd6bb3115be4bd118edd4e"
ecology
parents:
diff
changeset
|
1 #Rscript |
|
c586703ea141
"planemo upload for repository https://github.com/Marie59/Data_explo_tools commit 60627aba07951226c8fd6bb3115be4bd118edd4e"
ecology
parents:
diff
changeset
|
2 |
|
c586703ea141
"planemo upload for repository https://github.com/Marie59/Data_explo_tools commit 60627aba07951226c8fd6bb3115be4bd118edd4e"
ecology
parents:
diff
changeset
|
3 ######################################################################################### |
|
c586703ea141
"planemo upload for repository https://github.com/Marie59/Data_explo_tools commit 60627aba07951226c8fd6bb3115be4bd118edd4e"
ecology
parents:
diff
changeset
|
4 ####################### Exploration data tools function ################################# |
|
c586703ea141
"planemo upload for repository https://github.com/Marie59/Data_explo_tools commit 60627aba07951226c8fd6bb3115be4bd118edd4e"
ecology
parents:
diff
changeset
|
5 ######################################################################################### |
|
c586703ea141
"planemo upload for repository https://github.com/Marie59/Data_explo_tools commit 60627aba07951226c8fd6bb3115be4bd118edd4e"
ecology
parents:
diff
changeset
|
6 #### Based on Romain Lorrillière R script |
|
c586703ea141
"planemo upload for repository https://github.com/Marie59/Data_explo_tools commit 60627aba07951226c8fd6bb3115be4bd118edd4e"
ecology
parents:
diff
changeset
|
7 #### Modified by Alan Amosse, Benjamin Yguel and Marie Jossé for integrating within Galaxy-E |
|
c586703ea141
"planemo upload for repository https://github.com/Marie59/Data_explo_tools commit 60627aba07951226c8fd6bb3115be4bd118edd4e"
ecology
parents:
diff
changeset
|
8 |
|
c586703ea141
"planemo upload for repository https://github.com/Marie59/Data_explo_tools commit 60627aba07951226c8fd6bb3115be4bd118edd4e"
ecology
parents:
diff
changeset
|
9 ######################################### start of the function makeTableAnalyse |
|
c586703ea141
"planemo upload for repository https://github.com/Marie59/Data_explo_tools commit 60627aba07951226c8fd6bb3115be4bd118edd4e"
ecology
parents:
diff
changeset
|
10 ##Species are placed in separated columns and addition of zero on plots where at least one selected species is present |
|
c586703ea141
"planemo upload for repository https://github.com/Marie59/Data_explo_tools commit 60627aba07951226c8fd6bb3115be4bd118edd4e"
ecology
parents:
diff
changeset
|
11 make_table_analyse <- function(data, var, spe, var2, var3) { |
|
c586703ea141
"planemo upload for repository https://github.com/Marie59/Data_explo_tools commit 60627aba07951226c8fd6bb3115be4bd118edd4e"
ecology
parents:
diff
changeset
|
12 tab <- reshape(data |
|
c586703ea141
"planemo upload for repository https://github.com/Marie59/Data_explo_tools commit 60627aba07951226c8fd6bb3115be4bd118edd4e"
ecology
parents:
diff
changeset
|
13 , v.names = var |
|
c586703ea141
"planemo upload for repository https://github.com/Marie59/Data_explo_tools commit 60627aba07951226c8fd6bb3115be4bd118edd4e"
ecology
parents:
diff
changeset
|
14 , idvar = c(var2, var3) |
|
c586703ea141
"planemo upload for repository https://github.com/Marie59/Data_explo_tools commit 60627aba07951226c8fd6bb3115be4bd118edd4e"
ecology
parents:
diff
changeset
|
15 , timevar = spe |
|
c586703ea141
"planemo upload for repository https://github.com/Marie59/Data_explo_tools commit 60627aba07951226c8fd6bb3115be4bd118edd4e"
ecology
parents:
diff
changeset
|
16 , direction = "wide") |
|
c586703ea141
"planemo upload for repository https://github.com/Marie59/Data_explo_tools commit 60627aba07951226c8fd6bb3115be4bd118edd4e"
ecology
parents:
diff
changeset
|
17 tab[is.na(tab)] <- 0 ###### remplace les na par des 0 / replace NAs by 0 |
|
c586703ea141
"planemo upload for repository https://github.com/Marie59/Data_explo_tools commit 60627aba07951226c8fd6bb3115be4bd118edd4e"
ecology
parents:
diff
changeset
|
18 |
|
c586703ea141
"planemo upload for repository https://github.com/Marie59/Data_explo_tools commit 60627aba07951226c8fd6bb3115be4bd118edd4e"
ecology
parents:
diff
changeset
|
19 colnames(tab) <- sub(paste0(var, "."), "", colnames(tab))### remplace le premier pattern "abond." par le second "" / replace the column names "abond." by "" |
|
c586703ea141
"planemo upload for repository https://github.com/Marie59/Data_explo_tools commit 60627aba07951226c8fd6bb3115be4bd118edd4e"
ecology
parents:
diff
changeset
|
20 return(tab) |
|
c586703ea141
"planemo upload for repository https://github.com/Marie59/Data_explo_tools commit 60627aba07951226c8fd6bb3115be4bd118edd4e"
ecology
parents:
diff
changeset
|
21 } |
|
c586703ea141
"planemo upload for repository https://github.com/Marie59/Data_explo_tools commit 60627aba07951226c8fd6bb3115be4bd118edd4e"
ecology
parents:
diff
changeset
|
22 ######################################### end of the function makeTableAnalyse |
