Skip to content

Commit adec61e

Browse files
authored
Update write_chroms.R with changes per discussion in PR
1 parent 4846f02 commit adec61e

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

R/write_chroms.R

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,7 @@ nc_add_global_attributes <- function(nc, meta, sample_name){
275275
format_metadata_for_cdf <- function(x){
276276
datetime <- format(attr(x, "run_datetime"), "%Y%m%d%H%M%S%z")
277277
if (length(datetime) == 0) {
278-
datetime <- format(Sys.time(), "%Y%m%d%H%M%S%z")
278+
datetime <- ""
279279
}
280280
rt_units <- attr(x, "time_unit")
281281
rt_units <- ifelse(!is.null(rt_units), tolower(rt_units), NA)
@@ -315,6 +315,7 @@ format_metadata_for_cdf <- function(x){
315315
ifelse(length(meta$sample_amount) != 0, meta$sample_amount, 1)
316316
meta$sample_injection_volume <-
317317
ifelse(length(meta$sample_injection_volume) != 0, meta$sample_injection_volume, 1)
318+
meta[sapply(meta, length) == 0] <- ""
318319
meta[sapply(meta, is.null)] <- ""
319320
meta[sapply(meta, is.na)] <- ""
320321
meta

0 commit comments

Comments
 (0)