From 34b37c94a648b8490a9f73872bf755567be85597 Mon Sep 17 00:00:00 2001 From: Ben Raymond Date: Mon, 16 Mar 2020 21:33:03 +1100 Subject: [PATCH] fix writing when match date is NA --- DESCRIPTION | 2 +- R/write.R | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index b79734f..365efc8 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: datavolley Title: Reading and Analyzing DataVolley Scouting Files -Version: 0.13.0 +Version: 0.13.1 Authors@R: person("Ben", "Raymond", email = "ben@untan.gl", role = c("aut", "cre")) Description: Provides functions for parsing and working with volleyball match files in DataVolley format. Depends: diff --git a/R/write.R b/R/write.R index 3ac3663..5f130d8 100644 --- a/R/write.R +++ b/R/write.R @@ -173,7 +173,7 @@ dvw_match <- function(x, text_encoding, date_format) { mm <- x$meta$match if (is.null(mm)) stop("missing the meta$match component of the input object") if (!missing(text_encoding)) mm$text_encoding <- text_encoding - mm$date <- format(mm$date, date_format) + if (!is.na(mm$date)) mm$date <- format(mm$date, date_format) c("[3MATCH]", df2txt(mm), ";;12345;;;;;;") }