R/filex_sanitize_section.R

Defines functions filex_sanitize_section

filex_sanitize_section <- function(sec_in){
  regex <- paste0(" +(",
                  paste0(
                    paste0("(",
                           c("-+FACTOR LEVELS-+",
                             "AND WATER MANAGEMENT",
                             "DETAILS",
                             "\\(INORGANIC\\)",
                             "AND ROTATIONS",
                             "CONTROLS",
                             "CONDITIONS",
                             "AND ORGANIC FERTILIZER",
                             "MODIFICATIONS"),
                           ")"
                    ),
                    collapse = "|"
                  ),
                  ")"
  )

  sec_out <- gsub(regex,
                  "",
                  sec_in)
  return(sec_out)
}

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.