试图使用read_csv函数读取csv:
library(readr)
read_csv("myfile.csv")返回警告:
Warning message in OlsonNames():
“no Olson database found”然后是错误:
Error: Unknown TZ UTC
Traceback:
1. read_csv("myfile.csv")
2. read_delimited(file, tokenizer, col_names = col_names, col_types = col_types,
. locale = locale, skip = skip, comment = comment, n_max = n_max,
. guess_max = guess_max, progress = progress)
3. col_spec_standardise(data, skip = skip, comment = comment, guess_max = guess_max,
. col_names = col_names, col_types = col_types, tokenizer = tokenizer,
. locale = locale)
4. guess_header(ds_header, tokenizer, locale)
5. guess_header_(datasource, tokenizer, locale)
6. default_locale()
7. locale()
8. check_tz(tz)
9. stop("Unknown TZ ", x, call. = FALSE)我在returned中没有收到此错误,所以假设Olson数据库是与returned一起预先安装的?
我如何在R木星笔记本上安装奥尔森数据库,以便read_csv按预期运行?
最新情况:
我在木星笔记本上使用OlsonNames()独立地调用相同的错误。我运行的木星笔记本是在https://github.com/jupyter/docker-stacks/tree/master/r-notebook指定的容器
更新2:
由docker文件指定的R包:
# R packages
RUN conda install --quiet --yes \
'r-base=3.3.2' \
'r-irkernel=0.7*' \
'r-plyr=1.8*' \
'r-devtools=1.12*' \
'r-tidyverse=1.0*' \
'r-shiny=0.14*' \
'r-rmarkdown=1.2*' \
'r-forecast=7.3*' \
'r-rsqlite=1.1*' \
'r-reshape2=1.4*' \
'r-nycflights13=0.2*' \
'r-caret=6.0*' \
'r-rcurl=1.95*' \
'r-crayon=1.3*' \
'r-randomforest=4.6*' && \
conda clean -tipsy && \
fix-permissions $CONDA_DIR操作系统: Ubuntu Core 14.04
R版本:
jovyan@6cf5af1246ff:~$ R -- version
WARNING: unknown option '--'
ARGUMENT 'version' __ignored__
R version 3.3.2 (2016-10-31) -- "Sincere Pumpkin Patch"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)
R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.
Natural language support but running in an English locale
R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.
Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.
[Previously saved workspace restored]
>发布于 2017-10-06 12:59:47
OlsonNames函数非常简单。在3.3.2中,它查找这些位置的时区名称:
tzdirs <- c(Sys.getenv("TZDIR"), file.path(R.home("share"),
"zoneinfo"), "/usr/share/zoneinfo", "/usr/share/lib/zoneinfo",
"/usr/lib/zoneinfo", "/usr/local/etc/zoneinfo", "/etc/zoneinfo",
"/usr/etc/zoneinfo")您需要确保列出的目录中有一个可用。如果系统上没有硬编码的,请将TZDIR设置为指向副本。
https://stackoverflow.com/questions/46590281
复制相似问题