From b32697f8969fdeb47009f230e2445acebfdb4915 Mon Sep 17 00:00:00 2001 From: Efrain Gonzalez Date: Thu, 22 Jun 2017 12:25:53 -0400 Subject: [PATCH] Automated version of RCleanDscret.R Updated gcnames function --- RAutoClDs.R | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/RAutoClDs.R b/RAutoClDs.R index 92f5c63..087f984 100644 --- a/RAutoClDs.R +++ b/RAutoClDs.R @@ -1,8 +1,6 @@ -######################################################################## -# Don't Use This Code Just Yet # -######################################################################## + #Efrain H. Gonzalez -#6/21/2017 +#6/22/2017 options(digits = 11) #Libraries required to run the code library(pryr) @@ -137,10 +135,10 @@ gcnames <- function(DiData,usecol=1){ i = 1 nwnam <- rep("0",length.out=nuruns) for(i in 1:nuruns){ - if(length(strsplit(colnames(DiData)[i],"///")[[1]]) >= usecol){ - nwnam[i]=str_trim(strsplit(colnames(DiData)[i],"///")[[1]][usecol]) + if(length(strsplit(colnames(DiData)[i],"///|//")[[1]]) >= usecol){ + nwnam[i]=str_trim(strsplit(colnames(DiData)[i],"///|//")[[1]][usecol]) } else{ - nwnam[i]=str_trim(strsplit(colnames(DiData)[i],"///")[[1]][1]) + nwnam[i]=str_trim(strsplit(colnames(DiData)[i],"///|//")[[1]][1]) } } -- 2.29.0