R/drop_comments.R

Defines functions drop_comments

drop_comments <- function(raw){
  # Strip comments from lines that are not only comments
  gsub("!.*", "",
       # Drop lines with only comments
       grep("(^ *!)", raw,
            value = TRUE, invert = TRUE)
  )
}

Try the DSSAT package in your browser

Any scripts or data that you put into this service are public.

DSSAT documentation built on Nov. 9, 2023, 1:08 a.m.