This is unfortunately a hard to fix bug caused by https://github.com/r-lib/tzdb/issues/10.
It looks like you are on Windows. The problem comes with having Unicode characters in your file path, i.e. 寰愭槑瀹?
.
In general R is not the best at handling Unicode in file paths, so there may be other places where you are going to get bitten by this outside of just readr. That said, this is a bug in tzdb and I would like to fix it eventually.
In the meantime, to fix this you have to do one of two things.
You could create a new user that doesn't have Unicode in the name and login as them. That is going to be the best long term solution to avoid any other Unicode issues with R and file paths (pretty much all your file paths are going to have your user name in the file path).
Or you could tell R to look for your package library in a different place. To do this you should open your .Renviron
file with usethis::edit_r_environ()
. You'll need to update the R_LIBS_USER
environment variable to a folder that doesn't have Unicode in the name. Possibly like:
R_LIBS_USER="C:/R/packages/%v"
This assumes that you can create a folder on your machine directly on your C drive, and that it doesn't have to be inside your User specific folder at C:/Users/寰愭槑瀹?
. If you can't create the folder shown above, this isn't going to work for you unfortunately.
The %v
is going to become the R version you are working on in the form of <major>.<minor>
. i.e. if you are on R 4.0.2 then that would become 4.0
.
For that to take effect, the folder actually has to exist on your computer, so you need to manually go create the folder C:/R/packages/4.0
(where you would substitute 4.0
for whatever your R version is. You can figure that out by typing R.version.string
in the R console).
Then if you restart R, .libPaths()
should return "C:/R/packages/4.0"
as the first path.
At that point you'll need to install tzdb again with install.packages("tzdb")
so that it puts it in that new folder.
If you get that far, restart R one more time and hopefully you can read the file with readr now.
I'm sorry that you are new to R and are experiencing this, I know this probably isn't very fun.