Dear gurus,
Yesterday I experienced an error while reading any Excel file with read_excel() function.
I checked the example from help system and error is still there.
library(readxl)
datasets <- readxl_example("datasets.xlsx")
read_excel(datasets)
Error: Can't convert a string to a character vector
Has anybody had such an error (under Windows 7 OS)? And what that can mean?
My session info:
sessionInfo()
R version 3.4.3 (2017-11-30)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 7 x64 (build 7601) Service Pack 1
Matrix products: default
locale:
[1] LC_COLLATE=Russian_Russia.1251 LC_CTYPE=Russian_Russia.1251
[3] LC_MONETARY=Russian_Russia.1251 LC_NUMERIC=C
[5] LC_TIME=Russian_Russia.1251
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] readxl_1.0.0
While doing debug() I have following:
read_excel(datasets)
debugging in: read_excel(datasets)
debug: {
read_excel_(path = path, sheet = sheet, range = range, col_names = col_names,
col_types = col_types, na = na, trim_ws = trim_ws, skip = skip,
n_max = n_max, guess_max = guess_max, excel_format(path))
}
Browse[2]> s
debug: read_excel_(path = path, sheet = sheet, range = range, col_names = col_names,
col_types = col_types, na = na, trim_ws = trim_ws, skip = skip,
n_max = n_max, guess_max = guess_max, excel_format(path))
Browse[2]> s
debugging in: read_excel_(path = path, sheet = sheet, range = range, col_names = col_names,
col_types = col_types, na = na, trim_ws = trim_ws, skip = skip,
n_max = n_max, guess_max = guess_max, excel_format(path))
debug: {
if (format == "xls") {
sheets_fun <- xls_sheets
read_fun <- read_xls_
}
else {
sheets_fun <- xlsx_sheets
read_fun <- read_xlsx_
}
sheet <- standardise_sheet(sheet, range, sheets_fun(path))
shim <- !is.null(range)
limits <- standardise_limits(range, skip, n_max, has_col_names = isTRUE(col_names))
col_types <- check_col_types(col_types)
guess_max <- check_guess_max(guess_max)
trim_ws <- check_bool(trim_ws, "trim_ws")
tibble::repair_names(tibble::as_tibble(read_fun(path = path,
sheet = sheet, limits = limits, shim = shim, col_names = col_names,
col_types = col_types, na = na, trim_ws = trim_ws, guess_max = guess_max),
validate = FALSE), prefix = "X", sep = "")
}
Browse[3]> n
debug: if (format == "xls") {
sheets_fun <- xls_sheets
read_fun <- read_xls_
} else {
sheets_fun <- xlsx_sheets
read_fun <- read_xlsx_
}
Browse[3]> n
debug: sheets_fun <- xlsx_sheets
Browse[3]> n
debug: read_fun <- read_xlsx_
Browse[3]> n
debug: sheet <- standardise_sheet(sheet, range, sheets_fun(path))
Browse[3]> n
debug: shim <- !is.null(range)
Browse[3]> n
debug: limits <- standardise_limits(range, skip, n_max, has_col_names = isTRUE(col_names))
Browse[3]> n
debug: col_types <- check_col_types(col_types)
Browse[3]> n
debug: guess_max <- check_guess_max(guess_max)
Browse[3]> n
debug: trim_ws <- check_bool(trim_ws, "trim_ws")
Browse[3]> n
debug: tibble::repair_names(tibble::as_tibble(read_fun(path = path,
sheet = sheet, limits = limits, shim = shim, col_names = col_names,
col_types = col_types, na = na, trim_ws = trim_ws, guess_max = guess_max),
validate = FALSE), prefix = "X", sep = "")
Browse[3]> s
debugging in: tibble::repair_names
debug: {
pkg <- as.character(substitute(pkg))
name <- as.character(substitute(name))
getExportedValue(pkg, name)
}
Browse[4]> n
debug: pkg <- as.character(substitute(pkg))
Browse[4]> n
debug: name <- as.character(substitute(name))
Browse[4]> n
debug: getExportedValue(pkg, name)
Browse[4]> s
debugging in: getExportedValue(pkg, name)
debug: {
ns <- asNamespace(ns)
if (isBaseNamespace(ns))
get(name, envir = ns, inherits = FALSE)
else {
if (!is.null(oNam <- .getNamespaceInfo(ns, "exports")[[name]])) {
get0(oNam, envir = ns)
}
else {
ld <- .getNamespaceInfo(ns, "lazydata")
if (!is.null(obj <- ld[[name]]))
obj
else {
if (exists(name, envir = ld, inherits = FALSE))
NULL
else stop(gettextf("'%s' is not an exported object from 'namespace:%s'",
name, getNamespaceName(ns)), call. = FALSE,
domain = NA)
}
}
}
}
Browse[5]> n
debug: ns <- asNamespace(ns)
Browse[5]> n
debug: if (isBaseNamespace(ns)) get(name, envir = ns, inherits = FALSE) else {
if (!is.null(oNam <- .getNamespaceInfo(ns, "exports")[[name]])) {
get0(oNam, envir = ns)
}
else {
ld <- .getNamespaceInfo(ns, "lazydata")
if (!is.null(obj <- ld[[name]]))
obj
else {
if (exists(name, envir = ld, inherits = FALSE))
NULL
else stop(gettextf("'%s' is not an exported object from 'namespace:%s'",
name, getNamespaceName(ns)), call. = FALSE, domain = NA)
}
}
}
Browse[5]> n
debug: if (!is.null(oNam <- .getNamespaceInfo(ns, "exports")[[name]])) {
get0(oNam, envir = ns)
} else {
ld <- .getNamespaceInfo(ns, "lazydata")
if (!is.null(obj <- ld[[name]]))
obj
else {
if (exists(name, envir = ld, inherits = FALSE))
NULL
else stop(gettextf("'%s' is not an exported object from 'namespace:%s'",
name, getNamespaceName(ns)), call. = FALSE, domain = NA)
}
}
Browse[5]> n
debug: get0(oNam, envir = ns)
Browse[5]> n
exiting from: getExportedValue(pkg, name)
exiting from: tibble::repair_names
exiting from: read_excel_(path = path, sheet = sheet, range = range, col_names = col_names,
col_types = col_types, na = na, trim_ws = trim_ws, skip = skip,
n_max = n_max, guess_max = guess_max, excel_format(path))
exiting from: read_excel(datasets)
Error: Can't convert a string to a character vector