diff --git a/NEWS.md b/NEWS.md index c09deff..c4fa0fe 100644 --- a/NEWS.md +++ b/NEWS.md @@ -6,6 +6,7 @@ minor changes - Improved messages on rerun in series() - Spec list in ?series is automatically parsed from the X-13 manual - Save output files if 'dir' is specified + - Improvements when reading spc files #320 #323 #321 1.9.0 diff --git a/R/import.spc.R b/R/import.spc.R index f9cc87e..46d0e03 100644 --- a/R/import.spc.R +++ b/R/import.spc.R @@ -98,7 +98,7 @@ import.spc <- function(file, text = NULL){ if (is.null(text)){ stopifnot(file.exists(file)) - text <- readLines(file) + text <- readLines(file, warn = FALSE) } else { stopifnot(inherits(text, "character")) text <- paste(text, collapse = "\n") @@ -361,7 +361,7 @@ import.ts <- function(file, if (format %in% c("datevalue", "datevaluecomma", "free", "freecomma")){ - txt <- readLines(file) + txt <- readLines(file, warn = FALSE) dec <- if (format %in% c("datevaluecomma", "freecomma")) "," else "." sep <- if (grepl("\\t", txt[2])) "\t" else " " @@ -497,7 +497,7 @@ import_fortran <- function(file, format, frequency, start = NULL, name = NULL){ import_tramo <- function(file){ - txt <- readLines(file) + txt <- readLines(file, warn = FALSE) ssp <- strsplit(gsub("^ +| +$", "", txt[2]), " ")[[1]] if (length(ssp) != 4){ stop("tramo format: line 2 must have 4 elements.")