找回密码
 注册
查看: 4725|回复: 0

R语言:Sys.setenv()函数中文帮助文档(中英文对照)

[复制链接]
发表于 2012-2-16 18:18:04 | 显示全部楼层 |阅读模式
Sys.setenv(base)
Sys.setenv()所属R语言包:base

                                        Set or Unset Environment Variables
                                         设置或取消环境变量

                                         译者:生物统计家园网 机器人LoveR

描述----------Description----------

Sys.setenv sets environment variables (for other processes called from within R or future calls to Sys.getenv from this R process).
Sys.setenv设置环境变量(在R或将来调用Sys.getenv这个R进程调用的其他进程)。

Sys.unsetenv removes environment variables.
Sys.unsetenv删除环境变量。


用法----------Usage----------


Sys.setenv(...)

Sys.unsetenv(x)



参数----------Arguments----------

参数:...
named arguments with values coercible to a character string.
与强制转换为字符串值命名参数。


参数:x
a character vector, or an object coercible to character.
一个字符向量,或者一个对象强制转换为字符。


Details

详情----------Details----------

Non-standard R names must be quoted in Sys.setenv: see the examples.  Most platforms (and POSIX) do not allow names containing "=".  Windows does, but the facilities provided by R may not handle these correctly so they should be avoided.  Most platforms allow setting an environment variable to "", but Windows does not, and there Sys.setenv(FOO="") unsets FOO.
非标准的R名称必须引用Sys.setenv:看到的例子。大多数平台(和POSIX)不允许含有"="的名称。 Windows一样,但由R提供的设施可能无法处理这些正确的,所以他们应避免。大多数平台可以设置环境变量"",但Windows不,有Sys.setenv(FOO="")取消设置FOO。

There may be system-specific limits on the maximum length of the values of individual environment variables or of all environment variables. Windows has a limit of 32,767 characters on the environment block, and cmd.exe has a limit of 2047 (Windows 2000) or 8192 characters (XP and later) for each value.
有可能是系统特定的限制,对个人的环境变量或所有的环境变量的值的最大长度。 Windows有一个对环境块的32,767个字符的限制,cmd.exe的2047(Windows 2000)或8192个字符限制为每个值(XP和更高版本)。


值----------Value----------

A logical vector, with elements being true if (un)setting the corresponding variable succeeded.  (For Sys.unsetenv this includes attempting to remove a non-existent variable.)
一个逻辑向量,如果(联合国)设置相应的变量成功的元素。 (Sys.unsetenv这包括试图删除一个不存在的变量。)


参见----------See Also----------

Sys.getenv, Startup for ways to set environment variables for the R session.
Sys.getenv,启动方式设置R会话的环境变量。

setwd for the working directory.
setwd工作目录。

The help for "environment variables" lists many of the environment variables used by R.
“环境变量”列表帮助许多由R.使用的环境变量


举例----------Examples----------


print(Sys.setenv(R_TEST="testit", "A+C"=123))  # `A+C` could also be used[A +也可以被用来]
Sys.getenv("R_TEST")
Sys.unsetenv("R_TEST")
Sys.getenv("R_TEST", unset=NA)

转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。


注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

手机版|小黑屋|生物统计家园 网站价格

GMT+8, 2025-2-3 00:46 , Processed in 0.024564 second(s), 15 queries .

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表