R/read_udg.R

Defines functions read_udg

read_udg <- function(file){
  # read and parse a .udg file
  #
  # file  full path without file ending
  #
  # return a named character vector with some statistics
  file.udg <- normalizePath(paste0(file, ".udg"), mustWork = TRUE)
  udg0 <- readLines(file.udg)
  udg1 <- read.table(text = paste(udg0[grepl(":", udg0)], collapse = "\n"), sep = ":", stringsAsFactors = FALSE)
  udg <- udg1[,-1]
  names(udg) <- udg1[,1]
  udg <- gsub("^ +| +$", "", udg)
  udg
}

Try the seasonal package in your browser

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

seasonal documentation built on April 18, 2022, 9:06 a.m.