From 8838e49a02607b03ebdf1adcf402f3ae4e35fbf4 Mon Sep 17 00:00:00 2001 From: Christoph Sax Date: Sun, 30 Jun 2024 13:28:34 +0200 Subject: [PATCH 1/2] Do not warn by default if EOL is missing in spc file --- R/import.spc.R | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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.") From 348a1d47889a77ea9a758cb92b703fa9126261b7 Mon Sep 17 00:00:00 2001 From: Christoph Sax Date: Sun, 30 Jun 2024 13:31:17 +0200 Subject: [PATCH 2/2] news --- NEWS.md | 1 + 1 file changed, 1 insertion(+) 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