Skip to content

xls path containing the "~" shortcut can't be read #498

Description

@lgtm70b

Minor issue: the '~' character on macOS used to point to the home folder causes readxl to throw an error.

library(readxl)
(xl <- read_excel('/Users/mbpro/codingprojects/tests/Book1.xls'))
#> New names:
#> abc -> abc..1
#> abc -> abc..2
#> # A tibble: 4 x 2
#>   abc..1 abc..2
#>    <dbl>  <dbl>
#> 1      4      2
#> 2      3      3
#> 3      7      5
#> 4      2      2
dput(xl)
#> structure(list(abc..1 = c(4, 3, 7, 2), abc..2 = c(2, 3, 5, 2)), row.names = c(NA, 
#> -4L), class = c("tbl_df", "tbl", "data.frame"))
read_excel('~/codingprojects/tests/Book1.xls')
#> Error in read_fun(path = enc2native(path), sheet_i = sheet, limits = limits, : Failed to open ~/codingprojects/tests/Book1.xls

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugan unexpected problem or unintended behaviorxls 👵

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions