Platform(base)
Platform()所属R语言包:base
Platform Specific Variables
平台特定的变量
译者:生物统计家园网 机器人LoveR
描述----------Description----------
.Platform is a list with some details of the platform under which R was built. This provides means to write OS-portable R code.
.Platform是一个列表中的一些细节,其中R是搭建平台。这提供了手段,写操作系统的便携式R代码。
用法----------Usage----------
.Platform
值----------Value----------
A list with at least the following components:
至少有以下几部分组成名单:
参数:OS.type
character string, giving the Operating System (family) of the computer. One of "unix" or "windows".
字符串,给电脑的操作系统(家庭)。一个"unix"或"windows"。
参数:file.sep
character string, giving the file separator used on your platform: "/" on both Unix-alikes and on Windows (but not on the once port to Classic Mac OS).
字符串,让您的平台上使用的文件分隔:"/"在Unix相似者和Windows上(而不是上一次端口的Mac OS)。
参数:dynlib.ext
character string, giving the file name extension of dynamically loadable libraries, e.g., ".dll" on Windows and ".so" or ".sl" on Unix-alikes. (Note for Mac OS X users: these are shared objects as loaded by dyn.load and not dylibs: see dyn.load.)
字符串,动态库文件扩展名,例如,".dll"在Windows和".so"或".sl"在Unix相似者。 (Mac OS X用户注意:这些共享对象,dyn.load和不dylibs的加载:看到dyn.load。)
参数:GUI
character string, giving the type of GUI in use, or "unknown" if no GUI can be assumed. Possible values are for Unix-alikes the values given via the -g command-line flag ("X11", "Tk"), "AQUA" (running under R.app on Mac OS X), "Rgui" and "RTerm" (Windows) and perhaps others under alternative front-ends or embedded R.
字符串,在使用的图形用户界面的类型,或"unknown"可以假设,如果没有GUI。可能的值是通过-g命令行标志("X11""Tk")"AQUA"(R.app在Mac下运行UNIX相似者给出的值OS X)"Rgui"和"RTerm"(Windows)和或许其他替代前端或嵌入式河下
参数:endian
character string, "big" or "little", giving the endianness of the processor in use. This is relevant when it is necessary to know the order to read/write bytes of e.g. an integer or double from/to a connection: see readBin.
字符串,"big"或"little",给人的处理器中使用的字节序。这是相关的,当它要知道,如读/写字节整数或双/连接:readBin。
参数:pkgType
character string, the preferred setting for options("pkgType"). Values "source", "mac.binary.leopard" and "win.binary" are currently in use.
字符串,options("pkgType")首选设置。值"source","mac.binary.leopard"和"win.binary"是目前使用的。
参数:path.sep
character string, giving the path separator, used on your platform, e.g., ":" on Unix-alikes and ";" on Windows. Used to separate paths in environment variables such as PATH and TEXINPUTS.
字符串,路径分隔符,在你的平台上使用,例如,":"在Unix相似者和";"在Windows。用来分隔路径的环境变量,如PATH和TEXINPUTS。
参数:r_arch
character string, possibly "". The name of an architecture-specific directory used in this build of R.
字符串,可能""。一个特定于体系结构的目录的名称在此构建的河
AQUA的----------AQUA----------
.Platform$GUI is set to "AQUA" under the Mac OS X GUI, R.app. This has a number of consequences:
.Platform$GUI设置为"AQUA"在Mac OS X的图形用户界面,R.app。这有一些后果:
the DISPLAY environment variable is set to ":0" if unset.
DISPLAY环境变量设置为":0"如果没有设置。
appends "/usr/local/bin" to the PATH environment variable.
追加/usr/local/binPATH环境变量。
the default graphics device is set to quartz.
默认图形设备设置为quartz。
selects native (rather than Tk) widgets for the graphics = TRUE options of menu and select.list.
选择本地的graphics = TRUEmenu和select.list选项(而不是TK)的部件。
HTML help is displayed in the internal browser.
在内部浏览器显示HTML帮助。
The spreadsheet-like data editor/viewer uses a Quartz version rather than the X11 one.
电子表格,如数据编辑器/浏览器使用石英,而不是X11的版本。
参见----------See Also----------
R.version and Sys.info give more details about the OS. In particular, R.version$platform is the canonical name of the platform under which R was compiled.
R.version和Sys.info给有关操作系统的更多细节。尤其是R.version$platform是其中R编译平台的规范名称。
.Machine for details of the arithmetic used, and system for invoking platform-specific system commands.
.Machine使用算术的细节,和system调用特定于平台的系统命令。
举例----------Examples----------
## Note: this can be done in a system-independent way[#注:这是可以做到在一个系统独立的方式]
## by file.info()$isdir[,#file.info()$ ISDIR]
if(.Platform$OS.type == "unix") {
system.test <- function(...) { system(paste("test", ...)) == 0 }
dir.exists <- function(dir)
sapply(dir, function(d) system.test("-d", d))
dir.exists(c(R.home(), "/tmp", "~", "/NO"))# > T T T F[> T T楼]
}
转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。
注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
|