R/helperFns.R

Defines functions addCommas

addCommas<-function(str){
  #if str includes spaces but isn't surrounded by commas then the commas are added
  
  if( length(grep(" ",str))>0  & length(grep("\"",str))==0 ){
    str <- paste("\"",str,"\"",sep="")
  }
    
  return(str)
  
}
stanfill/apsimr documentation built on May 30, 2019, 9:40 a.m.