R/fixCommas.R

Defines functions fixCommas

Documented in fixCommas

#' Fix comma formatting
#'
#' Call this function to format all commas selected with one space before and one after
#' 
#' @export

fixCommas <- function() {
  seltxt <- rstudioapi::getActiveDocumentContext()
  rstudioapi::insertText(gsub(" *, *", ", ", seltxt$selection[[1]]$text))
}
jachan1/addins documentation built on May 18, 2019, 7:16 a.m.