CRAN Package Check Results for Package blaise

Last updated on 2022-10-03 21:53:33 CEST.

Flavor Version Tinstall Tcheck Ttotal Status Flags
r-devel-linux-x86_64-debian-clang 1.3.8 9.19 78.65 87.84 OK
r-devel-linux-x86_64-debian-gcc 1.3.8 7.02 57.24 64.26 ERROR
r-devel-linux-x86_64-fedora-clang 1.3.8 85.52 ERROR
r-devel-linux-x86_64-fedora-gcc 1.3.8 63.23 ERROR
r-devel-windows-x86_64 1.3.8 39.00 103.00 142.00 ERROR
r-patched-linux-x86_64 1.3.8 7.22 72.77 79.99 OK
r-release-linux-x86_64 1.3.8 5.56 71.63 77.19 OK
r-release-macos-arm64 1.3.8 33.00 OK
r-release-macos-x86_64 1.3.8 65.00 OK
r-release-windows-x86_64 1.3.8 43.00 112.00 155.00 OK
r-oldrel-macos-arm64 1.3.8 25.00 OK
r-oldrel-macos-x86_64 1.3.8 43.00 OK
r-oldrel-windows-ix86+x86_64 1.3.8 20.00 98.00 118.00 OK

Check Details

Version: 1.3.8
Check: examples
Result: ERROR
    Running examples in ‘blaise-Ex.R’ failed
    The error most likely occurred in:
    
    > base::assign(".ptime", proc.time(), pos = "CheckExEnv")
    > ### Name: write_fwf_blaise_with_model
    > ### Title: Write a fixed width ascii datafile based on a given blaise
    > ### datamodel
    > ### Aliases: write_fwf_blaise_with_model
    >
    > ### ** Examples
    >
    > datafilename = tempfile('testdata', fileext = '.asc')
    > blafilename = tempfile('testbla', fileext = '.bla')
    >
    > model = "
    + DATAMODEL Test
    + FIELDS
    + A : STRING[1]
    + B : INTEGER[1]
    + C : REAL[3,1]
    + D : REAL[3]
    + E : (Male, Female)
    + F : 1..20
    + G : 1.00..100.00
    + H : DATETYPE
    + ENDMODEL
    + "
    > writeLines(model, con = blafilename)
    >
    > df = data.frame(
    + list(
    + A = rep('t',3),
    + B = 1:3,
    + C = 1.1:3.3,
    + D = 1.0:3.0,
    + E = factor(c(1,2,1), labels = c('Male', 'Female')),
    + F = 1:3,
    + G = c(1., 99.9, 78.5),
    + H = as.Date(rep('2001-01-01', 3))
    + )
    + )
    > write_fwf_blaise_with_model(df, datafilename, blafilename)
    Warning in as.character.POSIXt(as.POSIXlt(x), ...) :
     as.character(td, ..) no longer obeys a 'format' argument; use format(td, ..) ?
    >
    >
    > model = "
    + DATAMODEL Test
    + FIELDS
    + A : STRING[1]
    + B : STRING[1]
    + C : STRING[3]
    + E : STRING[1]
    + H : STRING[8]
    + ENDMODEL
    + "
    > writeLines(model, con = blafilename)
    >
    > df = data.frame(
    + list(
    + A = rep('t',3),
    + E = factor(c(1,2,1), labels = c('Male', 'Female')),
    + B = 1:3,
    + C = 1.1:3.3,
    + H = as.Date(rep('2001-01-01', 3))
    + ),
    + stringsAsFactors = FALSE
    + )
    > write_fwf_blaise_with_model(df, datafilename, blafilename)
    Warning in as.character.POSIXt(as.POSIXlt(x), ...) :
     as.character(td, ..) no longer obeys a 'format' argument; use format(td, ..) ?
    Error in (function (col, var) :
     width in datamodel smaller than number of characters of largest element for variable: H
    Calls: write_fwf_blaise_with_model ... create_fixed_width_column -> as.data.frame -> mapply -> <Anonymous>
    Execution halted
Flavor: r-devel-linux-x86_64-debian-gcc

Version: 1.3.8
Check: tests
Result: ERROR
     Running ‘testthat.R’ [8s/16s]
    Running the tests in ‘tests/testthat.R’ failed.
    Complete output:
     > library(testthat)
     > library(blaise)
     >
     > test_check("blaise")
     [ FAIL 7 | WARN 0 | SKIP 0 | PASS 364 ]
    
     ══ Failed tests ════════════════════════════════════════════════════════════════
     ── Error (test_types.R:34:3): all types get read back identically for a dataframe ──
     Error in `(function (col, var)
     {
     nas = is.na(col)
     if (is.factor(col)) {
     if (is.numbered_enum(levels(col))) {
     col = as.character(col)
     col[!nas] = format(col[!nas], width = width(var),
     justify = justify)
     }
     else {
     col = as.integer(col)
     col[!nas] = format(col[!nas], width = width(var))
     }
     }
     else if (class(col) == "Date")
     col = as.character.Date(col, format = "%Y%m%d")
     else if (type(var) == "REAL" & !is.na(decimals(var))) {
     info = format.info(col[!nas])
     if (info[2] > decimals(var) | info[1] > width(var)) {
     message("reducing significance for variable ", name(var),
     " since the datamodel requires less significance")
     col = round(col, decimals(var))
     }
     if (width(var) == 1)
     stop("width can not be 1 or smaller for REAL:", name(var))
     col[!nas] = format(round(col[!nas], decimals(var)), decimal.mark = decimal.mark,
     digits = width(var) - 1, width = width(var), nsmall = decimals(var),
     scientific = FALSE)
     }
     else if (type(var) == "REAL" & is.na(decimals(var))) {
     info = format.info(col[!nas])
     if (info[1] > width(var)) {
     message("reducing significance for variable ", name(var),
     " since the datamodel requires less significance")
     col = signif(col, width(var) - 1)
     }
     if (width(var) == 1)
     stop("width can not be 1 or smaller for REAL:", name(var))
     col[!nas] = format(col[!nas], decimal.mark = decimal.mark,
     width = width(var), digits = width(var) - 1, scientific = FALSE)
     }
     else if (is.logical(col)) {
     message("variable ", name(var), " is automatically converted from logical to integer")
     col = as.integer(col)
     col[!nas] = format(col[!nas], width = width(var))
     }
     else col[!nas] = format(col[!nas], decimal.mark = decimal.mark,
     width = width(var), justify = justify, scientific = FALSE)
     col = replace_NA(col, width(var))
     nmax = format.info(col)[1]
     if (width(var) < nmax) {
     stop("width in datamodel smaller than number of characters of largest element for variable: ",
     name(var))
     }
     if (width(var) > nmax) {
     stop("width in datamodel larger than number of characters of largest element for variable: ",
     name(var))
     }
     return(col)
     })(dots[[1L]][[4L]], dots[[2L]][[4L]])`: width in datamodel smaller than number of characters of largest element for variable: date
     Backtrace:
     ▆
     1. └─blaise (local) expect_type_equal(df, "int") at test_types.R:34:2
     2. ├─base::eval(...) at test_types.R:20:2
     3. │ └─base::eval(...)
     4. ├─testthat::expect_silent(...)
     5. │ └─testthat:::quasi_capture(enquo(object), NULL, evaluate_promise)
     6. │ ├─testthat (local) .capture(...)
     7. │ │ ├─withr::with_output_sink(...)
     8. │ │ │ └─base::force(code)
     9. │ │ ├─base::withCallingHandlers(...)
     10. │ │ └─base::withVisible(code)
     11. │ └─rlang::eval_bare(quo_get_expr(.quo), quo_get_env(.quo))
     12. └─blaise::write_fwf_blaise(`<df[,5]>`, datafile, blafile, model_name = "test")
     13. └─blaise:::write_data(...)
     14. └─blaise:::create_fixed_width_column(df, model, decimal.mark, justify)
     15. ├─base::as.data.frame(mapply(per_col, df, variables(model), SIMPLIFY = FALSE))
     16. └─base::mapply(per_col, df, variables(model), SIMPLIFY = FALSE)
     17. └─blaise (local) `<fn>`(dots[[1L]][[4L]], dots[[2L]][[4L]])
     ── Error (test_types.R:51:3): all types get read back identically for a tibble ──
     Error in `(function (col, var)
     {
     nas = is.na(col)
     if (is.factor(col)) {
     if (is.numbered_enum(levels(col))) {
     col = as.character(col)
     col[!nas] = format(col[!nas], width = width(var),
     justify = justify)
     }
     else {
     col = as.integer(col)
     col[!nas] = format(col[!nas], width = width(var))
     }
     }
     else if (class(col) == "Date")
     col = as.character.Date(col, format = "%Y%m%d")
     else if (type(var) == "REAL" & !is.na(decimals(var))) {
     info = format.info(col[!nas])
     if (info[2] > decimals(var) | info[1] > width(var)) {
     message("reducing significance for variable ", name(var),
     " since the datamodel requires less significance")
     col = round(col, decimals(var))
     }
     if (width(var) == 1)
     stop("width can not be 1 or smaller for REAL:", name(var))
     col[!nas] = format(round(col[!nas], decimals(var)), decimal.mark = decimal.mark,
     digits = width(var) - 1, width = width(var), nsmall = decimals(var),
     scientific = FALSE)
     }
     else if (type(var) == "REAL" & is.na(decimals(var))) {
     info = format.info(col[!nas])
     if (info[1] > width(var)) {
     message("reducing significance for variable ", name(var),
     " since the datamodel requires less significance")
     col = signif(col, width(var) - 1)
     }
     if (width(var) == 1)
     stop("width can not be 1 or smaller for REAL:", name(var))
     col[!nas] = format(col[!nas], decimal.mark = decimal.mark,
     width = width(var), digits = width(var) - 1, scientific = FALSE)
     }
     else if (is.logical(col)) {
     message("variable ", name(var), " is automatically converted from logical to integer")
     col = as.integer(col)
     col[!nas] = format(col[!nas], width = width(var))
     }
     else col[!nas] = format(col[!nas], decimal.mark = decimal.mark,
     width = width(var), justify = justify, scientific = FALSE)
     col = replace_NA(col, width(var))
     nmax = format.info(col)[1]
     if (width(var) < nmax) {
     stop("width in datamodel smaller than number of characters of largest element for variable: ",
     name(var))
     }
     if (width(var) > nmax) {
     stop("width in datamodel larger than number of characters of largest element for variable: ",
     name(var))
     }
     return(col)
     })(dots[[1L]][[4L]], dots[[2L]][[4L]])`: width in datamodel smaller than number of characters of largest element for variable: date
     Backtrace:
     ▆
     1. └─blaise (local) expect_type_equal(df, "int") at test_types.R:51:2
     2. ├─base::eval(...) at test_types.R:20:2
     3. │ └─base::eval(...)
     4. ├─testthat::expect_silent(...)
     5. │ └─testthat:::quasi_capture(enquo(object), NULL, evaluate_promise)
     6. │ ├─testthat (local) .capture(...)
     7. │ │ ├─withr::with_output_sink(...)
     8. │ │ │ └─base::force(code)
     9. │ │ ├─base::withCallingHandlers(...)
     10. │ │ └─base::withVisible(code)
     11. │ └─rlang::eval_bare(quo_get_expr(.quo), quo_get_env(.quo))
     12. └─blaise::write_fwf_blaise(`<tibble[,5]>`, datafile, blafile, model_name = "test")
     13. └─blaise:::write_data(...)
     14. └─blaise:::create_fixed_width_column(df, model, decimal.mark, justify)
     15. ├─base::as.data.frame(mapply(per_col, df, variables(model), SIMPLIFY = FALSE))
     16. └─base::mapply(per_col, df, variables(model), SIMPLIFY = FALSE)
     17. └─blaise (local) `<fn>`(dots[[1L]][[4L]], dots[[2L]][[4L]])
     ── Error (test_types.R:78:3): all types get read back identically with NA ──────
     Error in `(function (col, var)
     {
     nas = is.na(col)
     if (is.factor(col)) {
     if (is.numbered_enum(levels(col))) {
     col = as.character(col)
     col[!nas] = format(col[!nas], width = width(var),
     justify = justify)
     }
     else {
     col = as.integer(col)
     col[!nas] = format(col[!nas], width = width(var))
     }
     }
     else if (class(col) == "Date")
     col = as.character.Date(col, format = "%Y%m%d")
     else if (type(var) == "REAL" & !is.na(decimals(var))) {
     info = format.info(col[!nas])
     if (info[2] > decimals(var) | info[1] > width(var)) {
     message("reducing significance for variable ", name(var),
     " since the datamodel requires less significance")
     col = round(col, decimals(var))
     }
     if (width(var) == 1)
     stop("width can not be 1 or smaller for REAL:", name(var))
     col[!nas] = format(round(col[!nas], decimals(var)), decimal.mark = decimal.mark,
     digits = width(var) - 1, width = width(var), nsmall = decimals(var),
     scientific = FALSE)
     }
     else if (type(var) == "REAL" & is.na(decimals(var))) {
     info = format.info(col[!nas])
     if (info[1] > width(var)) {
     message("reducing significance for variable ", name(var),
     " since the datamodel requires less significance")
     col = signif(col, width(var) - 1)
     }
     if (width(var) == 1)
     stop("width can not be 1 or smaller for REAL:", name(var))
     col[!nas] = format(col[!nas], decimal.mark = decimal.mark,
     width = width(var), digits = width(var) - 1, scientific = FALSE)
     }
     else if (is.logical(col)) {
     message("variable ", name(var), " is automatically converted from logical to integer")
     col = as.integer(col)
     col[!nas] = format(col[!nas], width = width(var))
     }
     else col[!nas] = format(col[!nas], decimal.mark = decimal.mark,
     width = width(var), justify = justify, scientific = FALSE)
     col = replace_NA(col, width(var))
     nmax = format.info(col)[1]
     if (width(var) < nmax) {
     stop("width in datamodel smaller than number of characters of largest element for variable: ",
     name(var))
     }
     if (width(var) > nmax) {
     stop("width in datamodel larger than number of characters of largest element for variable: ",
     name(var))
     }
     return(col)
     })(dots[[1L]][[4L]], dots[[2L]][[4L]])`: width in datamodel smaller than number of characters of largest element for variable: date
     Backtrace:
     ▆
     1. └─blaise (local) expect_type_equal(df, "int") at test_types.R:78:2
     2. ├─base::eval(...) at test_types.R:20:2
     3. │ └─base::eval(...)
     4. ├─testthat::expect_silent(...)
     5. │ └─testthat:::quasi_capture(enquo(object), NULL, evaluate_promise)
     6. │ ├─testthat (local) .capture(...)
     7. │ │ ├─withr::with_output_sink(...)
     8. │ │ │ └─base::force(code)
     9. │ │ ├─base::withCallingHandlers(...)
     10. │ │ └─base::withVisible(code)
     11. │ └─rlang::eval_bare(quo_get_expr(.quo), quo_get_env(.quo))
     12. └─blaise::write_fwf_blaise(`<df[,5]>`, datafile, blafile, model_name = "test")
     13. └─blaise:::write_data(...)
     14. └─blaise:::create_fixed_width_column(df, model, decimal.mark, justify)
     15. ├─base::as.data.frame(mapply(per_col, df, variables(model), SIMPLIFY = FALSE))
     16. └─base::mapply(per_col, df, variables(model), SIMPLIFY = FALSE)
     17. └─blaise (local) `<fn>`(dots[[1L]][[4L]], dots[[2L]][[4L]])
     ── Failure (test_write_fwf_blaise_with_model.R:46:3): input_model passes an identical dataframe with common types ──
     `write_fwf_blaise_with_model(df, datafile, blafile)` produced warnings.
     ── Error (test_write_fwf_blaise_with_model.R:249:3): Date is automatically casted to YYYYmmdd when string casting ──
     Error in `(function (col, var)
     {
     nas = is.na(col)
     if (is.factor(col)) {
     if (is.numbered_enum(levels(col))) {
     col = as.character(col)
     col[!nas] = format(col[!nas], width = width(var),
     justify = justify)
     }
     else {
     col = as.integer(col)
     col[!nas] = format(col[!nas], width = width(var))
     }
     }
     else if (class(col) == "Date")
     col = as.character.Date(col, format = "%Y%m%d")
     else if (type(var) == "REAL" & !is.na(decimals(var))) {
     info = format.info(col[!nas])
     if (info[2] > decimals(var) | info[1] > width(var)) {
     message("reducing significance for variable ", name(var),
     " since the datamodel requires less significance")
     col = round(col, decimals(var))
     }
     if (width(var) == 1)
     stop("width can not be 1 or smaller for REAL:", name(var))
     col[!nas] = format(round(col[!nas], decimals(var)), decimal.mark = decimal.mark,
     digits = width(var) - 1, width = width(var), nsmall = decimals(var),
     scientific = FALSE)
     }
     else if (type(var) == "REAL" & is.na(decimals(var))) {
     info = format.info(col[!nas])
     if (info[1] > width(var)) {
     message("reducing significance for variable ", name(var),
     " since the datamodel requires less significance")
     col = signif(col, width(var) - 1)
     }
     if (width(var) == 1)
     stop("width can not be 1 or smaller for REAL:", name(var))
     col[!nas] = format(col[!nas], decimal.mark = decimal.mark,
     width = width(var), digits = width(var) - 1, scientific = FALSE)
     }
     else if (is.logical(col)) {
     message("variable ", name(var), " is automatically converted from logical to integer")
     col = as.integer(col)
     col[!nas] = format(col[!nas], width = width(var))
     }
     else col[!nas] = format(col[!nas], decimal.mark = decimal.mark,
     width = width(var), justify = justify, scientific = FALSE)
     col = replace_NA(col, width(var))
     nmax = format.info(col)[1]
     if (width(var) < nmax) {
     stop("width in datamodel smaller than number of characters of largest element for variable: ",
     name(var))
     }
     if (width(var) > nmax) {
     stop("width in datamodel larger than number of characters of largest element for variable: ",
     name(var))
     }
     return(col)
     })(dots[[1L]][[1L]], dots[[2L]][[1L]])`: width in datamodel smaller than number of characters of largest element for variable: H
     Backtrace:
     ▆
     1. ├─testthat::expect_silent(...) at test_write_fwf_blaise_with_model.R:249:2
     2. │ └─testthat:::quasi_capture(enquo(object), NULL, evaluate_promise)
     3. │ ├─testthat (local) .capture(...)
     4. │ │ ├─withr::with_output_sink(...)
     5. │ │ │ └─base::force(code)
     6. │ │ ├─base::withCallingHandlers(...)
     7. │ │ └─base::withVisible(code)
     8. │ └─rlang::eval_bare(quo_get_expr(.quo), quo_get_env(.quo))
     9. └─blaise::write_fwf_blaise_with_model(df, datafile, input_model = blafile)
     10. └─blaise:::write_data(...)
     11. └─blaise:::create_fixed_width_column(df, model, decimal.mark, justify)
     12. ├─base::as.data.frame(mapply(per_col, df, variables(model), SIMPLIFY = FALSE))
     13. └─base::mapply(per_col, df, variables(model), SIMPLIFY = FALSE)
     14. └─blaise (local) `<fn>`(dots[[1L]][[1L]], dots[[2L]][[1L]])
     ── Error (test_write_fwf_blaise_with_model.R:286:3): types are converted properly and can be converted back without loss ──
     Error in `(function (col, var)
     {
     nas = is.na(col)
     if (is.factor(col)) {
     if (is.numbered_enum(levels(col))) {
     col = as.character(col)
     col[!nas] = format(col[!nas], width = width(var),
     justify = justify)
     }
     else {
     col = as.integer(col)
     col[!nas] = format(col[!nas], width = width(var))
     }
     }
     else if (class(col) == "Date")
     col = as.character.Date(col, format = "%Y%m%d")
     else if (type(var) == "REAL" & !is.na(decimals(var))) {
     info = format.info(col[!nas])
     if (info[2] > decimals(var) | info[1] > width(var)) {
     message("reducing significance for variable ", name(var),
     " since the datamodel requires less significance")
     col = round(col, decimals(var))
     }
     if (width(var) == 1)
     stop("width can not be 1 or smaller for REAL:", name(var))
     col[!nas] = format(round(col[!nas], decimals(var)), decimal.mark = decimal.mark,
     digits = width(var) - 1, width = width(var), nsmall = decimals(var),
     scientific = FALSE)
     }
     else if (type(var) == "REAL" & is.na(decimals(var))) {
     info = format.info(col[!nas])
     if (info[1] > width(var)) {
     message("reducing significance for variable ", name(var),
     " since the datamodel requires less significance")
     col = signif(col, width(var) - 1)
     }
     if (width(var) == 1)
     stop("width can not be 1 or smaller for REAL:", name(var))
     col[!nas] = format(col[!nas], decimal.mark = decimal.mark,
     width = width(var), digits = width(var) - 1, scientific = FALSE)
     }
     else if (is.logical(col)) {
     message("variable ", name(var), " is automatically converted from logical to integer")
     col = as.integer(col)
     col[!nas] = format(col[!nas], width = width(var))
     }
     else col[!nas] = format(col[!nas], decimal.mark = decimal.mark,
     width = width(var), justify = justify, scientific = FALSE)
     col = replace_NA(col, width(var))
     nmax = format.info(col)[1]
     if (width(var) < nmax) {
     stop("width in datamodel smaller than number of characters of largest element for variable: ",
     name(var))
     }
     if (width(var) > nmax) {
     stop("width in datamodel larger than number of characters of largest element for variable: ",
     name(var))
     }
     return(col)
     })(dots[[1L]][[5L]], dots[[2L]][[5L]])`: width in datamodel smaller than number of characters of largest element for variable: H
     Backtrace:
     ▆
     1. ├─testthat::expect_silent(...) at test_write_fwf_blaise_with_model.R:286:2
     2. │ └─testthat:::quasi_capture(enquo(object), NULL, evaluate_promise)
     3. │ ├─testthat (local) .capture(...)
     4. │ │ ├─withr::with_output_sink(...)
     5. │ │ │ └─base::force(code)
     6. │ │ ├─base::withCallingHandlers(...)
     7. │ │ └─base::withVisible(code)
     8. │ └─rlang::eval_bare(quo_get_expr(.quo), quo_get_env(.quo))
     9. └─blaise::write_fwf_blaise_with_model(df, datafile, input_model = blafile)
     10. └─blaise:::write_data(...)
     11. └─blaise:::create_fixed_width_column(df, model, decimal.mark, justify)
     12. ├─base::as.data.frame(mapply(per_col, df, variables(model), SIMPLIFY = FALSE))
     13. └─base::mapply(per_col, df, variables(model), SIMPLIFY = FALSE)
     14. └─blaise (local) `<fn>`(dots[[1L]][[5L]], dots[[2L]][[5L]])
     ── Failure (test_write_fwf_blaise_with_model.R:383:3): input_model works with lower case or mixed case types ──
     `write_fwf_blaise_with_model(df, datafile, blafile)` produced warnings.
    
     [ FAIL 7 | WARN 0 | SKIP 0 | PASS 364 ]
     Error: Test failures
     Execution halted
Flavor: r-devel-linux-x86_64-debian-gcc

Version: 1.3.8
Check: examples
Result: ERROR
    Running examples in ‘blaise-Ex.R’ failed
    The error most likely occurred in:
    
    > ### Name: write_fwf_blaise_with_model
    > ### Title: Write a fixed width ascii datafile based on a given blaise
    > ### datamodel
    > ### Aliases: write_fwf_blaise_with_model
    >
    > ### ** Examples
    >
    > datafilename = tempfile('testdata', fileext = '.asc')
    > blafilename = tempfile('testbla', fileext = '.bla')
    >
    > model = "
    + DATAMODEL Test
    + FIELDS
    + A : STRING[1]
    + B : INTEGER[1]
    + C : REAL[3,1]
    + D : REAL[3]
    + E : (Male, Female)
    + F : 1..20
    + G : 1.00..100.00
    + H : DATETYPE
    + ENDMODEL
    + "
    > writeLines(model, con = blafilename)
    >
    > df = data.frame(
    + list(
    + A = rep('t',3),
    + B = 1:3,
    + C = 1.1:3.3,
    + D = 1.0:3.0,
    + E = factor(c(1,2,1), labels = c('Male', 'Female')),
    + F = 1:3,
    + G = c(1., 99.9, 78.5),
    + H = as.Date(rep('2001-01-01', 3))
    + )
    + )
    > write_fwf_blaise_with_model(df, datafilename, blafilename)
    Warning in as.character.POSIXt(as.POSIXlt(x), ...) :
     as.character(td, ..) no longer obeys a 'format' argument; use format(td, ..) ?
    >
    >
    > model = "
    + DATAMODEL Test
    + FIELDS
    + A : STRING[1]
    + B : STRING[1]
    + C : STRING[3]
    + E : STRING[1]
    + H : STRING[8]
    + ENDMODEL
    + "
    > writeLines(model, con = blafilename)
    >
    > df = data.frame(
    + list(
    + A = rep('t',3),
    + E = factor(c(1,2,1), labels = c('Male', 'Female')),
    + B = 1:3,
    + C = 1.1:3.3,
    + H = as.Date(rep('2001-01-01', 3))
    + ),
    + stringsAsFactors = FALSE
    + )
    > write_fwf_blaise_with_model(df, datafilename, blafilename)
    Warning in as.character.POSIXt(as.POSIXlt(x), ...) :
     as.character(td, ..) no longer obeys a 'format' argument; use format(td, ..) ?
    Error in (function (col, var) :
     width in datamodel smaller than number of characters of largest element for variable: H
    Calls: write_fwf_blaise_with_model ... create_fixed_width_column -> as.data.frame -> mapply -> <Anonymous>
    Execution halted
Flavors: r-devel-linux-x86_64-fedora-clang, r-devel-linux-x86_64-fedora-gcc, r-devel-windows-x86_64

Version: 1.3.8
Check: tests
Result: ERROR
     Running ‘testthat.R’
    Running the tests in ‘tests/testthat.R’ failed.
    Complete output:
     > library(testthat)
     > library(blaise)
     >
     > test_check("blaise")
     [ FAIL 7 | WARN 0 | SKIP 0 | PASS 364 ]
    
     ══ Failed tests ════════════════════════════════════════════════════════════════
     ── Error (test_types.R:34:3): all types get read back identically for a dataframe ──
     Error in `(function (col, var)
     {
     nas = is.na(col)
     if (is.factor(col)) {
     if (is.numbered_enum(levels(col))) {
     col = as.character(col)
     col[!nas] = format(col[!nas], width = width(var),
     justify = justify)
     }
     else {
     col = as.integer(col)
     col[!nas] = format(col[!nas], width = width(var))
     }
     }
     else if (class(col) == "Date")
     col = as.character.Date(col, format = "%Y%m%d")
     else if (type(var) == "REAL" & !is.na(decimals(var))) {
     info = format.info(col[!nas])
     if (info[2] > decimals(var) | info[1] > width(var)) {
     message("reducing significance for variable ", name(var),
     " since the datamodel requires less significance")
     col = round(col, decimals(var))
     }
     if (width(var) == 1)
     stop("width can not be 1 or smaller for REAL:", name(var))
     col[!nas] = format(round(col[!nas], decimals(var)), decimal.mark = decimal.mark,
     digits = width(var) - 1, width = width(var), nsmall = decimals(var),
     scientific = FALSE)
     }
     else if (type(var) == "REAL" & is.na(decimals(var))) {
     info = format.info(col[!nas])
     if (info[1] > width(var)) {
     message("reducing significance for variable ", name(var),
     " since the datamodel requires less significance")
     col = signif(col, width(var) - 1)
     }
     if (width(var) == 1)
     stop("width can not be 1 or smaller for REAL:", name(var))
     col[!nas] = format(col[!nas], decimal.mark = decimal.mark,
     width = width(var), digits = width(var) - 1, scientific = FALSE)
     }
     else if (is.logical(col)) {
     message("variable ", name(var), " is automatically converted from logical to integer")
     col = as.integer(col)
     col[!nas] = format(col[!nas], width = width(var))
     }
     else col[!nas] = format(col[!nas], decimal.mark = decimal.mark,
     width = width(var), justify = justify, scientific = FALSE)
     col = replace_NA(col, width(var))
     nmax = format.info(col)[1]
     if (width(var) < nmax) {
     stop("width in datamodel smaller than number of characters of largest element for variable: ",
     name(var))
     }
     if (width(var) > nmax) {
     stop("width in datamodel larger than number of characters of largest element for variable: ",
     name(var))
     }
     return(col)
     })(dots[[1L]][[4L]], dots[[2L]][[4L]])`: width in datamodel smaller than number of characters of largest element for variable: date
     Backtrace:
     ▆
     1. └─blaise (local) expect_type_equal(df, "int") at test_types.R:34:2
     2. ├─base::eval(...) at test_types.R:20:2
     3. │ └─base::eval(...)
     4. ├─testthat::expect_silent(...)
     5. │ └─testthat:::quasi_capture(enquo(object), NULL, evaluate_promise)
     6. │ ├─testthat (local) .capture(...)
     7. │ │ ├─withr::with_output_sink(...)
     8. │ │ │ └─base::force(code)
     9. │ │ ├─base::withCallingHandlers(...)
     10. │ │ └─base::withVisible(code)
     11. │ └─rlang::eval_bare(quo_get_expr(.quo), quo_get_env(.quo))
     12. └─blaise::write_fwf_blaise(`<df[,5]>`, datafile, blafile, model_name = "test")
     13. └─blaise:::write_data(...)
     14. └─blaise:::create_fixed_width_column(df, model, decimal.mark, justify)
     15. ├─base::as.data.frame(mapply(per_col, df, variables(model), SIMPLIFY = FALSE))
     16. └─base::mapply(per_col, df, variables(model), SIMPLIFY = FALSE)
     17. └─blaise (local) `<fn>`(dots[[1L]][[4L]], dots[[2L]][[4L]])
     ── Error (test_types.R:51:3): all types get read back identically for a tibble ──
     Error in `(function (col, var)
     {
     nas = is.na(col)
     if (is.factor(col)) {
     if (is.numbered_enum(levels(col))) {
     col = as.character(col)
     col[!nas] = format(col[!nas], width = width(var),
     justify = justify)
     }
     else {
     col = as.integer(col)
     col[!nas] = format(col[!nas], width = width(var))
     }
     }
     else if (class(col) == "Date")
     col = as.character.Date(col, format = "%Y%m%d")
     else if (type(var) == "REAL" & !is.na(decimals(var))) {
     info = format.info(col[!nas])
     if (info[2] > decimals(var) | info[1] > width(var)) {
     message("reducing significance for variable ", name(var),
     " since the datamodel requires less significance")
     col = round(col, decimals(var))
     }
     if (width(var) == 1)
     stop("width can not be 1 or smaller for REAL:", name(var))
     col[!nas] = format(round(col[!nas], decimals(var)), decimal.mark = decimal.mark,
     digits = width(var) - 1, width = width(var), nsmall = decimals(var),
     scientific = FALSE)
     }
     else if (type(var) == "REAL" & is.na(decimals(var))) {
     info = format.info(col[!nas])
     if (info[1] > width(var)) {
     message("reducing significance for variable ", name(var),
     " since the datamodel requires less significance")
     col = signif(col, width(var) - 1)
     }
     if (width(var) == 1)
     stop("width can not be 1 or smaller for REAL:", name(var))
     col[!nas] = format(col[!nas], decimal.mark = decimal.mark,
     width = width(var), digits = width(var) - 1, scientific = FALSE)
     }
     else if (is.logical(col)) {
     message("variable ", name(var), " is automatically converted from logical to integer")
     col = as.integer(col)
     col[!nas] = format(col[!nas], width = width(var))
     }
     else col[!nas] = format(col[!nas], decimal.mark = decimal.mark,
     width = width(var), justify = justify, scientific = FALSE)
     col = replace_NA(col, width(var))
     nmax = format.info(col)[1]
     if (width(var) < nmax) {
     stop("width in datamodel smaller than number of characters of largest element for variable: ",
     name(var))
     }
     if (width(var) > nmax) {
     stop("width in datamodel larger than number of characters of largest element for variable: ",
     name(var))
     }
     return(col)
     })(dots[[1L]][[4L]], dots[[2L]][[4L]])`: width in datamodel smaller than number of characters of largest element for variable: date
     Backtrace:
     ▆
     1. └─blaise (local) expect_type_equal(df, "int") at test_types.R:51:2
     2. ├─base::eval(...) at test_types.R:20:2
     3. │ └─base::eval(...)
     4. ├─testthat::expect_silent(...)
     5. │ └─testthat:::quasi_capture(enquo(object), NULL, evaluate_promise)
     6. │ ├─testthat (local) .capture(...)
     7. │ │ ├─withr::with_output_sink(...)
     8. │ │ │ └─base::force(code)
     9. │ │ ├─base::withCallingHandlers(...)
     10. │ │ └─base::withVisible(code)
     11. │ └─rlang::eval_bare(quo_get_expr(.quo), quo_get_env(.quo))
     12. └─blaise::write_fwf_blaise(`<tibble[,5]>`, datafile, blafile, model_name = "test")
     13. └─blaise:::write_data(...)
     14. └─blaise:::create_fixed_width_column(df, model, decimal.mark, justify)
     15. ├─base::as.data.frame(mapply(per_col, df, variables(model), SIMPLIFY = FALSE))
     16. └─base::mapply(per_col, df, variables(model), SIMPLIFY = FALSE)
     17. └─blaise (local) `<fn>`(dots[[1L]][[4L]], dots[[2L]][[4L]])
     ── Error (test_types.R:78:3): all types get read back identically with NA ──────
     Error in `(function (col, var)
     {
     nas = is.na(col)
     if (is.factor(col)) {
     if (is.numbered_enum(levels(col))) {
     col = as.character(col)
     col[!nas] = format(col[!nas], width = width(var),
     justify = justify)
     }
     else {
     col = as.integer(col)
     col[!nas] = format(col[!nas], width = width(var))
     }
     }
     else if (class(col) == "Date")
     col = as.character.Date(col, format = "%Y%m%d")
     else if (type(var) == "REAL" & !is.na(decimals(var))) {
     info = format.info(col[!nas])
     if (info[2] > decimals(var) | info[1] > width(var)) {
     message("reducing significance for variable ", name(var),
     " since the datamodel requires less significance")
     col = round(col, decimals(var))
     }
     if (width(var) == 1)
     stop("width can not be 1 or smaller for REAL:", name(var))
     col[!nas] = format(round(col[!nas], decimals(var)), decimal.mark = decimal.mark,
     digits = width(var) - 1, width = width(var), nsmall = decimals(var),
     scientific = FALSE)
     }
     else if (type(var) == "REAL" & is.na(decimals(var))) {
     info = format.info(col[!nas])
     if (info[1] > width(var)) {
     message("reducing significance for variable ", name(var),
     " since the datamodel requires less significance")
     col = signif(col, width(var) - 1)
     }
     if (width(var) == 1)
     stop("width can not be 1 or smaller for REAL:", name(var))
     col[!nas] = format(col[!nas], decimal.mark = decimal.mark,
     width = width(var), digits = width(var) - 1, scientific = FALSE)
     }
     else if (is.logical(col)) {
     message("variable ", name(var), " is automatically converted from logical to integer")
     col = as.integer(col)
     col[!nas] = format(col[!nas], width = width(var))
     }
     else col[!nas] = format(col[!nas], decimal.mark = decimal.mark,
     width = width(var), justify = justify, scientific = FALSE)
     col = replace_NA(col, width(var))
     nmax = format.info(col)[1]
     if (width(var) < nmax) {
     stop("width in datamodel smaller than number of characters of largest element for variable: ",
     name(var))
     }
     if (width(var) > nmax) {
     stop("width in datamodel larger than number of characters of largest element for variable: ",
     name(var))
     }
     return(col)
     })(dots[[1L]][[4L]], dots[[2L]][[4L]])`: width in datamodel smaller than number of characters of largest element for variable: date
     Backtrace:
     ▆
     1. └─blaise (local) expect_type_equal(df, "int") at test_types.R:78:2
     2. ├─base::eval(...) at test_types.R:20:2
     3. │ └─base::eval(...)
     4. ├─testthat::expect_silent(...)
     5. │ └─testthat:::quasi_capture(enquo(object), NULL, evaluate_promise)
     6. │ ├─testthat (local) .capture(...)
     7. │ │ ├─withr::with_output_sink(...)
     8. │ │ │ └─base::force(code)
     9. │ │ ├─base::withCallingHandlers(...)
     10. │ │ └─base::withVisible(code)
     11. │ └─rlang::eval_bare(quo_get_expr(.quo), quo_get_env(.quo))
     12. └─blaise::write_fwf_blaise(`<df[,5]>`, datafile, blafile, model_name = "test")
     13. └─blaise:::write_data(...)
     14. └─blaise:::create_fixed_width_column(df, model, decimal.mark, justify)
     15. ├─base::as.data.frame(mapply(per_col, df, variables(model), SIMPLIFY = FALSE))
     16. └─base::mapply(per_col, df, variables(model), SIMPLIFY = FALSE)
     17. └─blaise (local) `<fn>`(dots[[1L]][[4L]], dots[[2L]][[4L]])
     ── Failure (test_write_fwf_blaise_with_model.R:46:3): input_model passes an identical dataframe with common types ──
     `write_fwf_blaise_with_model(df, datafile, blafile)` produced warnings.
     ── Error (test_write_fwf_blaise_with_model.R:249:3): Date is automatically casted to YYYYmmdd when string casting ──
     Error in `(function (col, var)
     {
     nas = is.na(col)
     if (is.factor(col)) {
     if (is.numbered_enum(levels(col))) {
     col = as.character(col)
     col[!nas] = format(col[!nas], width = width(var),
     justify = justify)
     }
     else {
     col = as.integer(col)
     col[!nas] = format(col[!nas], width = width(var))
     }
     }
     else if (class(col) == "Date")
     col = as.character.Date(col, format = "%Y%m%d")
     else if (type(var) == "REAL" & !is.na(decimals(var))) {
     info = format.info(col[!nas])
     if (info[2] > decimals(var) | info[1] > width(var)) {
     message("reducing significance for variable ", name(var),
     " since the datamodel requires less significance")
     col = round(col, decimals(var))
     }
     if (width(var) == 1)
     stop("width can not be 1 or smaller for REAL:", name(var))
     col[!nas] = format(round(col[!nas], decimals(var)), decimal.mark = decimal.mark,
     digits = width(var) - 1, width = width(var), nsmall = decimals(var),
     scientific = FALSE)
     }
     else if (type(var) == "REAL" & is.na(decimals(var))) {
     info = format.info(col[!nas])
     if (info[1] > width(var)) {
     message("reducing significance for variable ", name(var),
     " since the datamodel requires less significance")
     col = signif(col, width(var) - 1)
     }
     if (width(var) == 1)
     stop("width can not be 1 or smaller for REAL:", name(var))
     col[!nas] = format(col[!nas], decimal.mark = decimal.mark,
     width = width(var), digits = width(var) - 1, scientific = FALSE)
     }
     else if (is.logical(col)) {
     message("variable ", name(var), " is automatically converted from logical to integer")
     col = as.integer(col)
     col[!nas] = format(col[!nas], width = width(var))
     }
     else col[!nas] = format(col[!nas], decimal.mark = decimal.mark,
     width = width(var), justify = justify, scientific = FALSE)
     col = replace_NA(col, width(var))
     nmax = format.info(col)[1]
     if (width(var) < nmax) {
     stop("width in datamodel smaller than number of characters of largest element for variable: ",
     name(var))
     }
     if (width(var) > nmax) {
     stop("width in datamodel larger than number of characters of largest element for variable: ",
     name(var))
     }
     return(col)
     })(dots[[1L]][[1L]], dots[[2L]][[1L]])`: width in datamodel smaller than number of characters of largest element for variable: H
     Backtrace:
     ▆
     1. ├─testthat::expect_silent(...) at test_write_fwf_blaise_with_model.R:249:2
     2. │ └─testthat:::quasi_capture(enquo(object), NULL, evaluate_promise)
     3. │ ├─testthat (local) .capture(...)
     4. │ │ ├─withr::with_output_sink(...)
     5. │ │ │ └─base::force(code)
     6. │ │ ├─base::withCallingHandlers(...)
     7. │ │ └─base::withVisible(code)
     8. │ └─rlang::eval_bare(quo_get_expr(.quo), quo_get_env(.quo))
     9. └─blaise::write_fwf_blaise_with_model(df, datafile, input_model = blafile)
     10. └─blaise:::write_data(...)
     11. └─blaise:::create_fixed_width_column(df, model, decimal.mark, justify)
     12. ├─base::as.data.frame(mapply(per_col, df, variables(model), SIMPLIFY = FALSE))
     13. └─base::mapply(per_col, df, variables(model), SIMPLIFY = FALSE)
     14. └─blaise (local) `<fn>`(dots[[1L]][[1L]], dots[[2L]][[1L]])
     ── Error (test_write_fwf_blaise_with_model.R:286:3): types are converted properly and can be converted back without loss ──
     Error in `(function (col, var)
     {
     nas = is.na(col)
     if (is.factor(col)) {
     if (is.numbered_enum(levels(col))) {
     col = as.character(col)
     col[!nas] = format(col[!nas], width = width(var),
     justify = justify)
     }
     else {
     col = as.integer(col)
     col[!nas] = format(col[!nas], width = width(var))
     }
     }
     else if (class(col) == "Date")
     col = as.character.Date(col, format = "%Y%m%d")
     else if (type(var) == "REAL" & !is.na(decimals(var))) {
     info = format.info(col[!nas])
     if (info[2] > decimals(var) | info[1] > width(var)) {
     message("reducing significance for variable ", name(var),
     " since the datamodel requires less significance")
     col = round(col, decimals(var))
     }
     if (width(var) == 1)
     stop("width can not be 1 or smaller for REAL:", name(var))
     col[!nas] = format(round(col[!nas], decimals(var)), decimal.mark = decimal.mark,
     digits = width(var) - 1, width = width(var), nsmall = decimals(var),
     scientific = FALSE)
     }
     else if (type(var) == "REAL" & is.na(decimals(var))) {
     info = format.info(col[!nas])
     if (info[1] > width(var)) {
     message("reducing significance for variable ", name(var),
     " since the datamodel requires less significance")
     col = signif(col, width(var) - 1)
     }
     if (width(var) == 1)
     stop("width can not be 1 or smaller for REAL:", name(var))
     col[!nas] = format(col[!nas], decimal.mark = decimal.mark,
     width = width(var), digits = width(var) - 1, scientific = FALSE)
     }
     else if (is.logical(col)) {
     message("variable ", name(var), " is automatically converted from logical to integer")
     col = as.integer(col)
     col[!nas] = format(col[!nas], width = width(var))
     }
     else col[!nas] = format(col[!nas], decimal.mark = decimal.mark,
     width = width(var), justify = justify, scientific = FALSE)
     col = replace_NA(col, width(var))
     nmax = format.info(col)[1]
     if (width(var) < nmax) {
     stop("width in datamodel smaller than number of characters of largest element for variable: ",
     name(var))
     }
     if (width(var) > nmax) {
     stop("width in datamodel larger than number of characters of largest element for variable: ",
     name(var))
     }
     return(col)
     })(dots[[1L]][[5L]], dots[[2L]][[5L]])`: width in datamodel smaller than number of characters of largest element for variable: H
     Backtrace:
     ▆
     1. ├─testthat::expect_silent(...) at test_write_fwf_blaise_with_model.R:286:2
     2. │ └─testthat:::quasi_capture(enquo(object), NULL, evaluate_promise)
     3. │ ├─testthat (local) .capture(...)
     4. │ │ ├─withr::with_output_sink(...)
     5. │ │ │ └─base::force(code)
     6. │ │ ├─base::withCallingHandlers(...)
     7. │ │ └─base::withVisible(code)
     8. │ └─rlang::eval_bare(quo_get_expr(.quo), quo_get_env(.quo))
     9. └─blaise::write_fwf_blaise_with_model(df, datafile, input_model = blafile)
     10. └─blaise:::write_data(...)
     11. └─blaise:::create_fixed_width_column(df, model, decimal.mark, justify)
     12. ├─base::as.data.frame(mapply(per_col, df, variables(model), SIMPLIFY = FALSE))
     13. └─base::mapply(per_col, df, variables(model), SIMPLIFY = FALSE)
     14. └─blaise (local) `<fn>`(dots[[1L]][[5L]], dots[[2L]][[5L]])
     ── Failure (test_write_fwf_blaise_with_model.R:383:3): input_model works with lower case or mixed case types ──
     `write_fwf_blaise_with_model(df, datafile, blafile)` produced warnings.
    
     [ FAIL 7 | WARN 0 | SKIP 0 | PASS 364 ]
     Error: Test failures
     Execution halted
Flavors: r-devel-linux-x86_64-fedora-clang, r-devel-linux-x86_64-fedora-gcc

Version: 1.3.8
Check: tests
Result: ERROR
     Running 'testthat.R' [12s]
    Running the tests in 'tests/testthat.R' failed.
    Complete output:
     > library(testthat)
     > library(blaise)
     >
     > test_check("blaise")
     [ FAIL 7 | WARN 0 | SKIP 0 | PASS 364 ]
    
     ══ Failed tests ════════════════════════════════════════════════════════════════
     ── Error (test_types.R:34:3): all types get read back identically for a dataframe ──
     Error in `(function (col, var)
     {
     nas = is.na(col)
     if (is.factor(col)) {
     if (is.numbered_enum(levels(col))) {
     col = as.character(col)
     col[!nas] = format(col[!nas], width = width(var),
     justify = justify)
     }
     else {
     col = as.integer(col)
     col[!nas] = format(col[!nas], width = width(var))
     }
     }
     else if (class(col) == "Date")
     col = as.character.Date(col, format = "%Y%m%d")
     else if (type(var) == "REAL" & !is.na(decimals(var))) {
     info = format.info(col[!nas])
     if (info[2] > decimals(var) | info[1] > width(var)) {
     message("reducing significance for variable ", name(var),
     " since the datamodel requires less significance")
     col = round(col, decimals(var))
     }
     if (width(var) == 1)
     stop("width can not be 1 or smaller for REAL:", name(var))
     col[!nas] = format(round(col[!nas], decimals(var)), decimal.mark = decimal.mark,
     digits = width(var) - 1, width = width(var), nsmall = decimals(var),
     scientific = FALSE)
     }
     else if (type(var) == "REAL" & is.na(decimals(var))) {
     info = format.info(col[!nas])
     if (info[1] > width(var)) {
     message("reducing significance for variable ", name(var),
     " since the datamodel requires less significance")
     col = signif(col, width(var) - 1)
     }
     if (width(var) == 1)
     stop("width can not be 1 or smaller for REAL:", name(var))
     col[!nas] = format(col[!nas], decimal.mark = decimal.mark,
     width = width(var), digits = width(var) - 1, scientific = FALSE)
     }
     else if (is.logical(col)) {
     message("variable ", name(var), " is automatically converted from logical to integer")
     col = as.integer(col)
     col[!nas] = format(col[!nas], width = width(var))
     }
     else col[!nas] = format(col[!nas], decimal.mark = decimal.mark,
     width = width(var), justify = justify, scientific = FALSE)
     col = replace_NA(col, width(var))
     nmax = format.info(col)[1]
     if (width(var) < nmax) {
     stop("width in datamodel smaller than number of characters of largest element for variable: ",
     name(var))
     }
     if (width(var) > nmax) {
     stop("width in datamodel larger than number of characters of largest element for variable: ",
     name(var))
     }
     return(col)
     })(dots[[1L]][[4L]], dots[[2L]][[4L]])`: width in datamodel smaller than number of characters of largest element for variable: date
     Backtrace:
     ▆
     1. └─blaise (local) expect_type_equal(df, "int") at test_types.R:34:2
     2. ├─base::eval(...) at test_types.R:20:2
     3. │ └─base::eval(...)
     4. ├─testthat::expect_silent(...)
     5. │ └─testthat:::quasi_capture(enquo(object), NULL, evaluate_promise)
     6. │ ├─testthat (local) .capture(...)
     7. │ │ ├─withr::with_output_sink(...)
     8. │ │ │ └─base::force(code)
     9. │ │ ├─base::withCallingHandlers(...)
     10. │ │ └─base::withVisible(code)
     11. │ └─rlang::eval_bare(quo_get_expr(.quo), quo_get_env(.quo))
     12. └─blaise::write_fwf_blaise(`<df[,5]>`, datafile, blafile, model_name = "test")
     13. └─blaise:::write_data(...)
     14. └─blaise:::create_fixed_width_column(df, model, decimal.mark, justify)
     15. ├─base::as.data.frame(mapply(per_col, df, variables(model), SIMPLIFY = FALSE))
     16. └─base::mapply(per_col, df, variables(model), SIMPLIFY = FALSE)
     17. └─blaise (local) `<fn>`(dots[[1L]][[4L]], dots[[2L]][[4L]])
     ── Error (test_types.R:51:3): all types get read back identically for a tibble ──
     Error in `(function (col, var)
     {
     nas = is.na(col)
     if (is.factor(col)) {
     if (is.numbered_enum(levels(col))) {
     col = as.character(col)
     col[!nas] = format(col[!nas], width = width(var),
     justify = justify)
     }
     else {
     col = as.integer(col)
     col[!nas] = format(col[!nas], width = width(var))
     }
     }
     else if (class(col) == "Date")
     col = as.character.Date(col, format = "%Y%m%d")
     else if (type(var) == "REAL" & !is.na(decimals(var))) {
     info = format.info(col[!nas])
     if (info[2] > decimals(var) | info[1] > width(var)) {
     message("reducing significance for variable ", name(var),
     " since the datamodel requires less significance")
     col = round(col, decimals(var))
     }
     if (width(var) == 1)
     stop("width can not be 1 or smaller for REAL:", name(var))
     col[!nas] = format(round(col[!nas], decimals(var)), decimal.mark = decimal.mark,
     digits = width(var) - 1, width = width(var), nsmall = decimals(var),
     scientific = FALSE)
     }
     else if (type(var) == "REAL" & is.na(decimals(var))) {
     info = format.info(col[!nas])
     if (info[1] > width(var)) {
     message("reducing significance for variable ", name(var),
     " since the datamodel requires less significance")
     col = signif(col, width(var) - 1)
     }
     if (width(var) == 1)
     stop("width can not be 1 or smaller for REAL:", name(var))
     col[!nas] = format(col[!nas], decimal.mark = decimal.mark,
     width = width(var), digits = width(var) - 1, scientific = FALSE)
     }
     else if (is.logical(col)) {
     message("variable ", name(var), " is automatically converted from logical to integer")
     col = as.integer(col)
     col[!nas] = format(col[!nas], width = width(var))
     }
     else col[!nas] = format(col[!nas], decimal.mark = decimal.mark,
     width = width(var), justify = justify, scientific = FALSE)
     col = replace_NA(col, width(var))
     nmax = format.info(col)[1]
     if (width(var) < nmax) {
     stop("width in datamodel smaller than number of characters of largest element for variable: ",
     name(var))
     }
     if (width(var) > nmax) {
     stop("width in datamodel larger than number of characters of largest element for variable: ",
     name(var))
     }
     return(col)
     })(dots[[1L]][[4L]], dots[[2L]][[4L]])`: width in datamodel smaller than number of characters of largest element for variable: date
     Backtrace:
     ▆
     1. └─blaise (local) expect_type_equal(df, "int") at test_types.R:51:2
     2. ├─base::eval(...) at test_types.R:20:2
     3. │ └─base::eval(...)
     4. ├─testthat::expect_silent(...)
     5. │ └─testthat:::quasi_capture(enquo(object), NULL, evaluate_promise)
     6. │ ├─testthat (local) .capture(...)
     7. │ │ ├─withr::with_output_sink(...)
     8. │ │ │ └─base::force(code)
     9. │ │ ├─base::withCallingHandlers(...)
     10. │ │ └─base::withVisible(code)
     11. │ └─rlang::eval_bare(quo_get_expr(.quo), quo_get_env(.quo))
     12. └─blaise::write_fwf_blaise(`<tibble[,5]>`, datafile, blafile, model_name = "test")
     13. └─blaise:::write_data(...)
     14. └─blaise:::create_fixed_width_column(df, model, decimal.mark, justify)
     15. ├─base::as.data.frame(mapply(per_col, df, variables(model), SIMPLIFY = FALSE))
     16. └─base::mapply(per_col, df, variables(model), SIMPLIFY = FALSE)
     17. └─blaise (local) `<fn>`(dots[[1L]][[4L]], dots[[2L]][[4L]])
     ── Error (test_types.R:78:3): all types get read back identically with NA ──────
     Error in `(function (col, var)
     {
     nas = is.na(col)
     if (is.factor(col)) {
     if (is.numbered_enum(levels(col))) {
     col = as.character(col)
     col[!nas] = format(col[!nas], width = width(var),
     justify = justify)
     }
     else {
     col = as.integer(col)
     col[!nas] = format(col[!nas], width = width(var))
     }
     }
     else if (class(col) == "Date")
     col = as.character.Date(col, format = "%Y%m%d")
     else if (type(var) == "REAL" & !is.na(decimals(var))) {
     info = format.info(col[!nas])
     if (info[2] > decimals(var) | info[1] > width(var)) {
     message("reducing significance for variable ", name(var),
     " since the datamodel requires less significance")
     col = round(col, decimals(var))
     }
     if (width(var) == 1)
     stop("width can not be 1 or smaller for REAL:", name(var))
     col[!nas] = format(round(col[!nas], decimals(var)), decimal.mark = decimal.mark,
     digits = width(var) - 1, width = width(var), nsmall = decimals(var),
     scientific = FALSE)
     }
     else if (type(var) == "REAL" & is.na(decimals(var))) {
     info = format.info(col[!nas])
     if (info[1] > width(var)) {
     message("reducing significance for variable ", name(var),
     " since the datamodel requires less significance")
     col = signif(col, width(var) - 1)
     }
     if (width(var) == 1)
     stop("width can not be 1 or smaller for REAL:", name(var))
     col[!nas] = format(col[!nas], decimal.mark = decimal.mark,
     width = width(var), digits = width(var) - 1, scientific = FALSE)
     }
     else if (is.logical(col)) {
     message("variable ", name(var), " is automatically converted from logical to integer")
     col = as.integer(col)
     col[!nas] = format(col[!nas], width = width(var))
     }
     else col[!nas] = format(col[!nas], decimal.mark = decimal.mark,
     width = width(var), justify = justify, scientific = FALSE)
     col = replace_NA(col, width(var))
     nmax = format.info(col)[1]
     if (width(var) < nmax) {
     stop("width in datamodel smaller than number of characters of largest element for variable: ",
     name(var))
     }
     if (width(var) > nmax) {
     stop("width in datamodel larger than number of characters of largest element for variable: ",
     name(var))
     }
     return(col)
     })(dots[[1L]][[4L]], dots[[2L]][[4L]])`: width in datamodel smaller than number of characters of largest element for variable: date
     Backtrace:
     ▆
     1. └─blaise (local) expect_type_equal(df, "int") at test_types.R:78:2
     2. ├─base::eval(...) at test_types.R:20:2
     3. │ └─base::eval(...)
     4. ├─testthat::expect_silent(...)
     5. │ └─testthat:::quasi_capture(enquo(object), NULL, evaluate_promise)
     6. │ ├─testthat (local) .capture(...)
     7. │ │ ├─withr::with_output_sink(...)
     8. │ │ │ └─base::force(code)
     9. │ │ ├─base::withCallingHandlers(...)
     10. │ │ └─base::withVisible(code)
     11. │ └─rlang::eval_bare(quo_get_expr(.quo), quo_get_env(.quo))
     12. └─blaise::write_fwf_blaise(`<df[,5]>`, datafile, blafile, model_name = "test")
     13. └─blaise:::write_data(...)
     14. └─blaise:::create_fixed_width_column(df, model, decimal.mark, justify)
     15. ├─base::as.data.frame(mapply(per_col, df, variables(model), SIMPLIFY = FALSE))
     16. └─base::mapply(per_col, df, variables(model), SIMPLIFY = FALSE)
     17. └─blaise (local) `<fn>`(dots[[1L]][[4L]], dots[[2L]][[4L]])
     ── Failure (test_write_fwf_blaise_with_model.R:46:3): input_model passes an identical dataframe with common types ──
     `write_fwf_blaise_with_model(df, datafile, blafile)` produced warnings.
     ── Error (test_write_fwf_blaise_with_model.R:249:3): Date is automatically casted to YYYYmmdd when string casting ──
     Error in `(function (col, var)
     {
     nas = is.na(col)
     if (is.factor(col)) {
     if (is.numbered_enum(levels(col))) {
     col = as.character(col)
     col[!nas] = format(col[!nas], width = width(var),
     justify = justify)
     }
     else {
     col = as.integer(col)
     col[!nas] = format(col[!nas], width = width(var))
     }
     }
     else if (class(col) == "Date")
     col = as.character.Date(col, format = "%Y%m%d")
     else if (type(var) == "REAL" & !is.na(decimals(var))) {
     info = format.info(col[!nas])
     if (info[2] > decimals(var) | info[1] > width(var)) {
     message("reducing significance for variable ", name(var),
     " since the datamodel requires less significance")
     col = round(col, decimals(var))
     }
     if (width(var) == 1)
     stop("width can not be 1 or smaller for REAL:", name(var))
     col[!nas] = format(round(col[!nas], decimals(var)), decimal.mark = decimal.mark,
     digits = width(var) - 1, width = width(var), nsmall = decimals(var),
     scientific = FALSE)
     }
     else if (type(var) == "REAL" & is.na(decimals(var))) {
     info = format.info(col[!nas])
     if (info[1] > width(var)) {
     message("reducing significance for variable ", name(var),
     " since the datamodel requires less significance")
     col = signif(col, width(var) - 1)
     }
     if (width(var) == 1)
     stop("width can not be 1 or smaller for REAL:", name(var))
     col[!nas] = format(col[!nas], decimal.mark = decimal.mark,
     width = width(var), digits = width(var) - 1, scientific = FALSE)
     }
     else if (is.logical(col)) {
     message("variable ", name(var), " is automatically converted from logical to integer")
     col = as.integer(col)
     col[!nas] = format(col[!nas], width = width(var))
     }
     else col[!nas] = format(col[!nas], decimal.mark = decimal.mark,
     width = width(var), justify = justify, scientific = FALSE)
     col = replace_NA(col, width(var))
     nmax = format.info(col)[1]
     if (width(var) < nmax) {
     stop("width in datamodel smaller than number of characters of largest element for variable: ",
     name(var))
     }
     if (width(var) > nmax) {
     stop("width in datamodel larger than number of characters of largest element for variable: ",
     name(var))
     }
     return(col)
     })(dots[[1L]][[1L]], dots[[2L]][[1L]])`: width in datamodel smaller than number of characters of largest element for variable: H
     Backtrace:
     ▆
     1. ├─testthat::expect_silent(...) at test_write_fwf_blaise_with_model.R:249:2
     2. │ └─testthat:::quasi_capture(enquo(object), NULL, evaluate_promise)
     3. │ ├─testthat (local) .capture(...)
     4. │ │ ├─withr::with_output_sink(...)
     5. │ │ │ └─base::force(code)
     6. │ │ ├─base::withCallingHandlers(...)
     7. │ │ └─base::withVisible(code)
     8. │ └─rlang::eval_bare(quo_get_expr(.quo), quo_get_env(.quo))
     9. └─blaise::write_fwf_blaise_with_model(df, datafile, input_model = blafile)
     10. └─blaise:::write_data(...)
     11. └─blaise:::create_fixed_width_column(df, model, decimal.mark, justify)
     12. ├─base::as.data.frame(mapply(per_col, df, variables(model), SIMPLIFY = FALSE))
     13. └─base::mapply(per_col, df, variables(model), SIMPLIFY = FALSE)
     14. └─blaise (local) `<fn>`(dots[[1L]][[1L]], dots[[2L]][[1L]])
     ── Error (test_write_fwf_blaise_with_model.R:286:3): types are converted properly and can be converted back without loss ──
     Error in `(function (col, var)
     {
     nas = is.na(col)
     if (is.factor(col)) {
     if (is.numbered_enum(levels(col))) {
     col = as.character(col)
     col[!nas] = format(col[!nas], width = width(var),
     justify = justify)
     }
     else {
     col = as.integer(col)
     col[!nas] = format(col[!nas], width = width(var))
     }
     }
     else if (class(col) == "Date")
     col = as.character.Date(col, format = "%Y%m%d")
     else if (type(var) == "REAL" & !is.na(decimals(var))) {
     info = format.info(col[!nas])
     if (info[2] > decimals(var) | info[1] > width(var)) {
     message("reducing significance for variable ", name(var),
     " since the datamodel requires less significance")
     col = round(col, decimals(var))
     }
     if (width(var) == 1)
     stop("width can not be 1 or smaller for REAL:", name(var))
     col[!nas] = format(round(col[!nas], decimals(var)), decimal.mark = decimal.mark,
     digits = width(var) - 1, width = width(var), nsmall = decimals(var),
     scientific = FALSE)
     }
     else if (type(var) == "REAL" & is.na(decimals(var))) {
     info = format.info(col[!nas])
     if (info[1] > width(var)) {
     message("reducing significance for variable ", name(var),
     " since the datamodel requires less significance")
     col = signif(col, width(var) - 1)
     }
     if (width(var) == 1)
     stop("width can not be 1 or smaller for REAL:", name(var))
     col[!nas] = format(col[!nas], decimal.mark = decimal.mark,
     width = width(var), digits = width(var) - 1, scientific = FALSE)
     }
     else if (is.logical(col)) {
     message("variable ", name(var), " is automatically converted from logical to integer")
     col = as.integer(col)
     col[!nas] = format(col[!nas], width = width(var))
     }
     else col[!nas] = format(col[!nas], decimal.mark = decimal.mark,
     width = width(var), justify = justify, scientific = FALSE)
     col = replace_NA(col, width(var))
     nmax = format.info(col)[1]
     if (width(var) < nmax) {
     stop("width in datamodel smaller than number of characters of largest element for variable: ",
     name(var))
     }
     if (width(var) > nmax) {
     stop("width in datamodel larger than number of characters of largest element for variable: ",
     name(var))
     }
     return(col)
     })(dots[[1L]][[5L]], dots[[2L]][[5L]])`: width in datamodel smaller than number of characters of largest element for variable: H
     Backtrace:
     ▆
     1. ├─testthat::expect_silent(...) at test_write_fwf_blaise_with_model.R:286:2
     2. │ └─testthat:::quasi_capture(enquo(object), NULL, evaluate_promise)
     3. │ ├─testthat (local) .capture(...)
     4. │ │ ├─withr::with_output_sink(...)
     5. │ │ │ └─base::force(code)
     6. │ │ ├─base::withCallingHandlers(...)
     7. │ │ └─base::withVisible(code)
     8. │ └─rlang::eval_bare(quo_get_expr(.quo), quo_get_env(.quo))
     9. └─blaise::write_fwf_blaise_with_model(df, datafile, input_model = blafile)
     10. └─blaise:::write_data(...)
     11. └─blaise:::create_fixed_width_column(df, model, decimal.mark, justify)
     12. ├─base::as.data.frame(mapply(per_col, df, variables(model), SIMPLIFY = FALSE))
     13. └─base::mapply(per_col, df, variables(model), SIMPLIFY = FALSE)
     14. └─blaise (local) `<fn>`(dots[[1L]][[5L]], dots[[2L]][[5L]])
     ── Failure (test_write_fwf_blaise_with_model.R:383:3): input_model works with lower case or mixed case types ──
     `write_fwf_blaise_with_model(df, datafile, blafile)` produced warnings.
    
     [ FAIL 7 | WARN 0 | SKIP 0 | PASS 364 ]
     Error: Test failures
     Execution halted
Flavor: r-devel-windows-x86_64