gpt4 book ai didi

r - 更改我的 R 环境语言 (Ubuntu)

转载 作者:太空宇宙 更新时间:2023-11-03 16:55:00 25 4
gpt4 key购买 nike

举个例子:

> mean(eta)
# [1] NA
# Warning message:
# In mean.default(eta) : l'argomento non è numerico o logico: restituisco NA

> Sys.setenv(LANG = "en")
> mean(eta)
# [1] NA
# Warning message:
# In mean.default(eta) : l'argomento non è numerico o logico: restituisco NA

我的 renviron 文件,仍然无法运行:

### etc/Renviron.  Generated from Renviron.in by configure.
###
### ${R_HOME}/etc/Renviron
###
### Record R system environment variables.

Sys.setenv(LANGUAGE='en')
R_PLATFORM=${R_PLATFORM-'i686-pc-linux-gnu'}
## Default printer paper size: first record if user set R_PAPERSIZE
R_PAPERSIZE_USER=${R_PAPERSIZE-'a4'}
R_PAPERSIZE=${R_PAPERSIZE-'letter'}
## Default print command
R_PRINTCMD=${R_PRINTCMD-'/usr/bin/lpr'}

我认为问题是:

Sys.getenv(LANG)
Errore in Sys.getenv(LANG) : oggetto "LANG" non trovato

还有:

Sys.getenv(LANGUAGE)
Errore in Sys.getenv(LANGUAGE) : oggetto "LANGUAGE" non trovato

还有:

> sessionInfo()

R version 3.0.1 (2013-05-16)
Platform: i686-pc-linux-gnu (32-bit)

locale:
[1] LC_CTYPE=it_IT.UTF-8 LC_NUMERIC=C
[3] LC_TIME=it_IT.UTF-8 LC_COLLATE=it_IT.UTF-8
[5] LC_MONETARY=it_IT.UTF-8 LC_MESSAGES=it_IT.UTF-8
[7] LC_PAPER=C LC_NAME=C
[9] LC_ADDRESS=C LC_TELEPHONE=C
[11] LC_MEASUREMENT=it_IT.UTF-8 LC_IDENTIFICATION=C

attached base packages:
[1] stats graphics grDevices utils datasets methods base

other attached packages:
[1] entropy_1.2.0 ineq_0.2-11 moments_0.13

loaded via a namespace (and not attached):
[1] tools_3.0.1

> system("uname -a")

Linux lucas-K55VD 3.11.0-14-generic #21-Ubuntu SMP Tue Nov 12 17:07:40 UTC 2013 i6

还有:

> 2+x
Errore: oggetto "x" non trovato
> Sys.getenv("LANG")
[1] "it_IT.UTF-8"
> Sys.setenv(LANG='en')
> Sys.getenv("LANG")
[1] "en"
> 2+x
Errore: oggetto "x" non trovato

> Sys.setenv(LANG="en_US-UTF-8")
> 2+x
Errore: oggetto "x" non trovato
> system("locale -a | grep '^en'")
locale: Cannot set LC_CTYPE to default locale: No such file or directory
locale: Cannot set LC_MESSAGES to default locale: No such file or directory
locale: Cannot set LC_COLLATE to default locale: No such file or directory
en_AG
en_AG.utf8
en_AU.utf8
en_BW.utf8
en_CA.utf8
en_DK.utf8
en_GB.utf8
en_HK.utf8
en_IE.utf8
en_IN
en_IN.utf8
en_NG
en_NG.utf8
en_NZ.utf8
en_PH.utf8
en_SG.utf8
en_US.utf8
en_ZA.utf8
en_ZM
en_ZM.utf8
en_ZW.utf8

> Sys.setenv(LANG="en_US.utf8")
> 2+x
Errore: oggetto "x" non trovato

还有一件事:如果 stackoverflow 一直阻止我向其他人显示代码或控制台输出的尝试,我应该如何在此处显示 R 输出或代码?

最佳答案

请参阅 help(Startup) - 您必须在 ~/.Renviron 中进行设置,以便在主 R 进程启动之前进行设置。

关于r - 更改我的 R 环境语言 (Ubuntu),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20473944/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com