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

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

[复制链接]
发表于 2012-2-16 21:39:36 | 显示全部楼层 |阅读模式
basename(base)
basename()所属R语言包:base

                                        Manipulate File Paths
                                         处理文件路径

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

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

basename removes all of the path up to and including the last path separator (if any).
basename删除所有的路径,包括最后一个路径分隔符(如有)。

dirname returns the part of the path up to but excluding the last path separator, or "." if there is no path separator.
dirname返回path最多的一部分,但不包括最后的路径分隔符,或"."如果没有路径分隔符。


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


basename(path)
dirname(path)



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

参数:path
character vector, containing path names.
特征向量,包含路径名。


Details

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

For dirname tilde expansion of the path is done.
dirname波浪线扩张的道路。

Trailing path separators are removed before dissecting the path, and for dirname any trailing file separators are removed from the result.
尾随的路径分隔符被删除之前,解剖路径,dirname任何尾随的文件分隔符从结果中删除。


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

A character vector of the same length as path.  A zero-length input will give a zero-length output with no error.
一个path长度相同的特征向量。一个零长度的输入与零长度的输出没有错误。

If an element of path is NA, so is the result.
如果一个元素path是NA,这样的结果。


Windows上的运行情况----------Behaviour on Windows----------

On Windows this will accept either \ or / as the path separator, but dirname will return a path using / (except if on a network share, when the leading \\ will be preserved).  Expect these only to be able to handle complete paths, and not for example just a share or a drive.
在Windows中,这将接受要么\或/作为路径分隔符,但dirname将返回一个路径,使用/(除非在网络共享上,当领导 \\将被保留)。想到这些仅是能够处理例如只是一个共享或驱动器的完整路径,而不是。

UTF-8-encoded dirnames not valid in the current locale can be used.
可以使用UTF-8编码dirnames在当前语言环境的有效。


注意----------Note----------

These are not wrappers for the POSIX system functions of the same names: in particular they do <STRONG>not</STRONG> have the special handling of the path "/" and of returning "." for empty strings in basename.
这些都不是POSIX系统功能相同的名称包装:特别是他们做<STRONG>不会</ strong>有特殊处理的路径"/"回"."空字符串basename。


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

file.path, path.expand.
file.path,path.expand。


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


basename(file.path("","p1","p2","p3", c("file1", "file2")))
dirname(file.path("","p1","p2","p3","filename"))

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


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

使用道具 举报

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

本版积分规则

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

GMT+8, 2025-5-7 13:41 , Processed in 0.019782 second(s), 16 queries .

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

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