R/v_fmt_to_type.R

Defines functions v_fmt_to_type

v_fmt_to_type <- function(v_fmt, vnames = NULL){
  if(is.null(vnames)) vnames <- names(v_fmt)
  v_fmt[vnames] |>
    extr_substr("[a-z]") |>
    sapply(\(.x) switch(.x,
                        "f" = "numeric",
                        "s" = "character"))
}

Try the DSSAT package in your browser

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

DSSAT documentation built on June 24, 2024, 5:19 p.m.