Commit 31e5b3d1 authored by Blodgett, David L.'s avatar Blodgett, David L.

cran check issues

parent 3e2eec0c
......@@ -62,10 +62,10 @@ write_timeseries_dsg = function(nc_file, instance_names, lats, lons, times, data
time_units = 'days since 1970-01-01 00:00:00',
attributes=list(), add_to_existing=FALSE, overwrite = FALSE){
if(!overwrite && !add_to_existing && file.exists(nc_file)) stop("File already exists and overwrite is false.")
if(overwrite && !add_to_existing) unlink(file.exists(nc_file))
if(!overwrite & !add_to_existing & file.exists(nc_file)) stop("File already exists and overwrite is false.")
if(overwrite & !add_to_existing) unlink(file.exists(nc_file))
if(add_to_existing && !file.exists(nc_file)) add_to_existing=FALSE
if(add_to_existing & !file.exists(nc_file)) add_to_existing=FALSE
if(!is(times, 'POSIXct')){
times = as.POSIXct(times)
......
......@@ -149,7 +149,7 @@ test_that("Create basic DSG file",{
expect_equivalent(ncvar_get(testnc,varid="BCCA_0-125deg_pr_day_ACCESS1-0_rcp45_r1i1p1")[,71],test_data$all_data$`71`)
expect_equivalent(testnc$var$`BCCA_0-125deg_pr_day_ACCESS1-0_rcp45_r1i1p1`$units,"mm/d")
expect_equivalent(ncatt_get(testnc,varid=0,"summary")$value,'test summary')
expect("duplicate" %in% names(testnc$var))
expect("duplicate" %in% names(testnc$var), failure_message = names(testnc$var))
nc_close(testnc)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment