* using log directory 'd:/Rcompile/CRANpkg/local/3.4/pivot.Rcheck' * using R version 3.4.4 (2018-03-15) * using platform: x86_64-w64-mingw32 (64-bit) * using session charset: ISO8859-1 * checking for file 'pivot/DESCRIPTION' ... OK * this is package 'pivot' version '18.4.17' * package encoding: UTF-8 * checking package namespace information ... OK * checking package dependencies ... OK * checking if this is a source package ... OK * checking if there is a namespace ... OK * checking for hidden files and directories ... OK * checking for portable file names ... OK * checking whether package 'pivot' can be installed ... OK * checking installed package size ... OK * checking package directory ... OK * checking DESCRIPTION meta-information ... OK * checking top-level files ... OK * checking for left-over files ... OK * checking index information ... OK * checking package subdirectories ... OK * checking R files for non-ASCII characters ... OK * checking R files for syntax errors ... OK * checking whether the package can be loaded ... OK * checking whether the package can be loaded with stated dependencies ... OK * checking whether the package can be unloaded cleanly ... OK * checking whether the namespace can be loaded with stated dependencies ... OK * checking whether the namespace can be unloaded cleanly ... OK * checking loading without being on the library search path ... OK * checking use of S3 registration ... OK * checking dependencies in R code ... OK * checking S3 generic/method consistency ... OK * checking replacement functions ... OK * checking foreign function calls ... OK * checking R code for possible problems ... [5s] OK * checking Rd files ... OK * checking Rd metadata ... OK * checking Rd cross-references ... OK * checking for missing documentation entries ... OK * checking for code/documentation mismatches ... OK * checking Rd \usage sections ... OK * checking Rd contents ... OK * checking for unstated dependencies in examples ... OK * checking examples ... ERROR Running examples in 'pivot-Ex.R' failed The error most likely occurred in: > ### Name: pivot > ### Title: Pivot a table > ### Aliases: pivot > > ### ** Examples > > library(dplyr) Attaching package: 'dplyr' The following objects are masked from 'package:stats': filter, lag The following objects are masked from 'package:base': intersect, setdiff, setequal, union > library(dbplyr) Attaching package: 'dbplyr' The following objects are masked from 'package:dplyr': ident, sql > # establish db as a database connection > ## Don't show: > con <- simulate_mssql() > src <- src_dbi(con) > base <- list( x = ident('##iris') + , vars = tbl_vars(iris) + ) %>% structure(class=c('op_base_remote', 'op_base', 'op')) > db_iris <- structure( list( src = src + , ops = base + ) + , class = c('tbl_dbi', 'tbl_sql', 'tbl_lazy', 'tbl')) > ## End(Don't show) > ## Not run: > ##D db_iris <- copy_to(db, iris) > ## End(Not run) > result <- pivot( db_iris, Species, mean(Petal.Length, na.rm=TRUE) + , setosa, versicolor, virginica) > sql_render(result) Error: `con` must not be NULL Execution halted * checking for unstated dependencies in 'tests' ... OK * checking tests ... [4s] ERROR Running 'testthat.R' [4s] Running the tests in 'tests/testthat.R' failed. Complete output: > library(testthat) > library(pivot) > library(dbplyr) > library(dplyr) Attaching package: 'dplyr' The following objects are masked from 'package:dbplyr': ident, sql The following object is masked from 'package:testthat': matches The following objects are masked from 'package:stats': filter, lag The following objects are masked from 'package:base': intersect, setdiff, setequal, union > > test_check("pivot") -- 1. Error: PIVOT construction (@test-pivot.R#44) ---------------------------- `con` must not be NULL 1: sql_render(wide) at testthat/test-pivot.R:44 2: sql_render.tbl_lazy(wide) 3: sql_render(query$ops, con = con, ..., bare_identifier_ok = bare_identifier_ok) 4: sql_render.op(query$ops, con = con, ..., bare_identifier_ok = bare_identifier_ok) 5: sql_render(qry, con = con, ..., bare_identifier_ok = bare_identifier_ok) 6: sql_render.pivot_query(qry, con = con, ..., bare_identifier_ok = bare_identifier_ok) 7: sql_pivot(con = con, from = query$from, select = query$select, key = query$key, value = query$value, levels = query$levels, fill = query$fill) 8: `sql_pivot.Microsoft SQL Server`(con = con, from = query$from, select = query$select, key = query$key, value = query$value, levels = query$levels, fill = query$fill) 9: sql_pivot_MSSQLServer(...) 10: escape(levels, collapse = NULL) 11: stop("`con` must not be NULL", call. = FALSE) -- 2. Error: PIVOT warnings and errors (@test-pivot.R#71) --------------------- `con` must not be NULL 1: expect_warning({ sql_pivot_MSSQLServer(con, ident("##test"), ident(), ident("Key"), quo(Value), ident(c("a", "b", "c")), ident("Key"), fill = 0L) }, "Microsoft SQL Server Pivot Query requires an aggregate function.") at testthat/test-pivot.R:71 2: quasi_capture(enquo(object), label, capture_warnings) 3: .capture(act$val <- eval_bare(get_expr(.quo), get_env(.quo)), ...) 4: withCallingHandlers(code, warning = function(condition) { out$push(condition) invokeRestart("muffleWarning") }) 5: eval_bare(get_expr(.quo), get_env(.quo)) 6: sql_pivot_MSSQLServer(con, ident("##test"), ident(), ident("Key"), quo(Value), ident(c("a", "b", "c")), ident("Key"), fill = 0L) at testthat/test-pivot.R:72 7: dbplyr::sql(rlang::set_names(nm = ifelse(rlang::have_name(levels), names(levels), unclass(levels)), purrr::map_chr(escape(levels, collapse = NULL), ~build_sql("ISNULL(", dbplyr::sql(.), ",", fill, ")")) %>% rlang::set_names(levels))) 8: c_character(...) 9: rlang::set_names(nm = ifelse(rlang::have_name(levels), names(levels), unclass(levels)), purrr::map_chr(escape(levels, collapse = NULL), ~build_sql("ISNULL(", dbplyr::sql(.), ",", fill, ")")) %>% rlang::set_names(levels)) 10: set_names_impl(x, x, nm, ...) 11: is_vector(x) 12: purrr::map_chr(escape(levels, collapse = NULL), ~build_sql("ISNULL(", dbplyr::sql(.), ",", fill, ")")) %>% rlang::set_names(levels) 13: eval(lhs, parent, parent) 14: eval(lhs, parent, parent) 15: purrr::map_chr(escape(levels, collapse = NULL), ~build_sql("ISNULL(", dbplyr::sql(.), ",", fill, ")")) 16: escape(levels, collapse = NULL) 17: stop("`con` must not be NULL", call. = FALSE) -- 3. Error: spread.tbl_lazy (@test-tidyr.R#8) -------------------------------- `structure(list(Species = Species, Variable = ~Variable, Value = Value), .Names = c("Species", "Variable", "Value"))` must evaluate to column positions or names, not a list 1: spread(lazy.long, Species, mean(Value)) at testthat/test-tidyr.R:8 2: spread.tbl_lazy(lazy.long, Species, mean(Value)) 3: data %>% dplyr::group_by_(.dots = tidyselect::vars_select(dplyr::tbl_vars(data), tidyselect::everything(), .exclude = c(dplyr::select_var(dplyr::tbl_vars(data), !(!key)), all_names(value)))) %>% pivot(!(!key), !(!value), tidyselect::everything(), fill = fill) 4: withVisible(eval(quote(`_fseq`(`_lhs`)), env, env)) 5: eval(quote(`_fseq`(`_lhs`)), env, env) 6: eval(quote(`_fseq`(`_lhs`)), env, env) 7: `_fseq`(`_lhs`) 8: freduce(value, `_function_list`) 9: withVisible(function_list[[k]](value)) 10: function_list[[k]](value) ... 34: apply_op(op$x) 35: apply_op.op(op$x) 36: eval(e, envir = environment()) 37: eval(e, envir = environment()) 38: FUN(.data, vars = structure(list(Species = Species, Variable = ~Variable, Value = Value), .Names = c("Species", "Variable", "Value"))) 39: select.data.frame(.data, vars = structure(list(Species = Species, Variable = ~Variable, Value = Value), .Names = c("Species", "Variable", "Value"))) 40: tidyselect::vars_select(sel_vars(.data), !(!(!quos(...)))) 41: bad_calls(bad, "must evaluate to { singular(.vars) } positions or names, \\\n not { first_type }") 42: glubort(fmt_calls(calls), ..., .envir = .envir) 43: .abort(text) -- 4. Failure: UNPIVOT construction (@test-unpivot.R#45) ---------------------- `query` not equal to sql(...). 1/1 mismatches x[1]: "SELECT `Species`, `Variable`, `Value`\nFROM \"##iris\"\nUNPIVOT\n (\"V x[1]: alue\" FOR \"Variable\" IN\n (\"Sepal.Length\", \"Sepal.Width\", \" x[1]: Petal.Length\", \"Petal.Width\")\n ) AS \"Value\"" y[1]: "SELECT \"Species\", \"Variable\", \"Value\"\nFROM \"##iris\"\nUNPIVOT\n y[1]: (\"Value\" FOR \"Variable\" IN\n (\"Sepal.Length\", \"Sepal.Width y[1]: \", \"Petal.Length\", \"Petal.Width\")\n ) AS \"Value\"" -- 5. Failure: order_by (@test-unpivot.R#81) ---------------------------------- `sql` not identical to sql(...). 1/1 mismatches x[1]: "SELECT `Variable`, `Key`, `Value`\nFROM \"my_table\"\nUNPIVOT\n (\"Val x[1]: ue\" FOR \"Key\" IN\n (\"a\", \"b\", \"c\")\n ) AS \"Value\"\nOR x[1]: DER BY \"Key\", \"Variable\"" y[1]: "SELECT \"Variable\", \"Key\", \"Value\"\nFROM \"my_table\"\nUNPIVOT\n y[1]: (\"Value\" FOR \"Key\" IN\n (\"a\", \"b\", \"c\")\n ) AS \"Value y[1]: \"\nORDER BY \"Key\", \"Variable\"" -- 6. Failure: find_connection (@test-utils.R#11) ----------------------------- find_connection(lazy.long) not identical to `con`. names for target but not for current Attributes: < Component "class": 3 string mismatches > Length mismatch: comparison on first 0 components -- 7. Failure: find_connection (@test-utils.R#12) ----------------------------- find_connection(grouped) not identical to `con`. names for target but not for current Attributes: < Component "class": 3 string mismatches > Length mismatch: comparison on first 0 components -- 8. Error: get_pivot_levels (@test-utils.R#29) ------------------------------ `structure(list(Species = Species), .Names = "Species")` must evaluate to column positions or names, not a list 1: expect_identical(lazy.iris %>% select(Species) %>% distinct() %>% apply_op, iris %>% select(Species) %>% distinct()) at testthat/test-utils.R:29 2: quasi_label(enquo(object), label, arg = "object") 3: eval_bare(get_expr(quo), get_env(quo)) 4: lazy.iris %>% select(Species) %>% distinct() %>% apply_op 5: withVisible(eval(quote(`_fseq`(`_lhs`)), env, env)) 6: eval(quote(`_fseq`(`_lhs`)), env, env) 7: eval(quote(`_fseq`(`_lhs`)), env, env) 8: `_fseq`(`_lhs`) 9: freduce(value, `_function_list`) 10: withVisible(function_list[[k]](value)) ... 16: apply_op(op$x) 17: apply_op.op(op$x) 18: eval(e, envir = environment()) 19: eval(e, envir = environment()) 20: FUN(.data, vars = structure(list(Species = Species), .Names = "Species")) 21: select.data.frame(.data, vars = structure(list(Species = Species), .Names = "Species")) 22: tidyselect::vars_select(sel_vars(.data), !(!(!quos(...)))) 23: bad_calls(bad, "must evaluate to { singular(.vars) } positions or names, \\\n not { first_type }") 24: glubort(fmt_calls(calls), ..., .envir = .envir) 25: .abort(text) == testthat results =========================================================== OK: 61 SKIPPED: 1 WARNINGS: 4 FAILED: 8 1. Error: PIVOT construction (@test-pivot.R#44) 2. Error: PIVOT warnings and errors (@test-pivot.R#71) 3. Error: spread.tbl_lazy (@test-tidyr.R#8) 4. Failure: UNPIVOT construction (@test-unpivot.R#45) 5. Failure: order_by (@test-unpivot.R#81) 6. Failure: find_connection (@test-utils.R#11) 7. Failure: find_connection (@test-utils.R#12) 8. Error: get_pivot_levels (@test-utils.R#29) Error: testthat unit tests failed Execution halted * checking PDF version of manual ... OK * DONE Status: 2 ERRORs