Commit b32697f8969fdeb47009f230e2445acebfdb4915
1 parent
eccb7a19e2
Exists in
master
Automated version of RCleanDscret.R
Updated gcnames function
Showing
1 changed file
with
5 additions
and
7 deletions
Show diff stats
RAutoClDs.R
| 1 | -######################################################################## | |
| 2 | -# Don't Use This Code Just Yet # | |
| 3 | -######################################################################## | |
| 1 | + | |
| 4 | 2 | #Efrain H. Gonzalez |
| 5 | -#6/21/2017 | |
| 3 | +#6/22/2017 | |
| 6 | 4 | options(digits = 11) |
| 7 | 5 | #Libraries required to run the code |
| 8 | 6 | library(pryr) |
| ... | ... | @@ -137,10 +135,10 @@ gcnames <- function(DiData,usecol=1){ |
| 137 | 135 | i = 1 |
| 138 | 136 | nwnam <- rep("0",length.out=nuruns) |
| 139 | 137 | for(i in 1:nuruns){ |
| 140 | - if(length(strsplit(colnames(DiData)[i],"///")[[1]]) >= usecol){ | |
| 141 | - nwnam[i]=str_trim(strsplit(colnames(DiData)[i],"///")[[1]][usecol]) | |
| 138 | + if(length(strsplit(colnames(DiData)[i],"///|//")[[1]]) >= usecol){ | |
| 139 | + nwnam[i]=str_trim(strsplit(colnames(DiData)[i],"///|//")[[1]][usecol]) | |
| 142 | 140 | } else{ |
| 143 | - nwnam[i]=str_trim(strsplit(colnames(DiData)[i],"///")[[1]][1]) | |
| 141 | + nwnam[i]=str_trim(strsplit(colnames(DiData)[i],"///|//")[[1]][1]) | |
| 144 | 142 | } |
| 145 | 143 | |
| 146 | 144 | } |