strtrim(base)
strtrim()所属R语言包:base
Trim Character Strings to Specified Widths
微调字符串指定宽度
译者:生物统计家园网 机器人LoveR
描述----------Description----------
Trim character strings to specified display widths.
修剪字符串到指定的显示宽度。
用法----------Usage----------
strtrim(x, width)
参数----------Arguments----------
参数:x
a character vector, or an object which can be coerced to a character vector by as.character.
字符向量,或可强制字符向量对象as.character。
参数:width
Positive integer values: recycled to the length of x.
正整数的值:回收到的x长度。
Details
详情----------Details----------
"Width" is interpreted as the display width in a monospaced font. What happens with non-printable characters (such as backspace, tab) is implementation-dependent and may depend on the locale (e.g. they may be included in the count or they may be omitted).
宽被解释为在等宽字体显示宽度。会发生什么事与非打印字符(如退格,制表符)是依赖于实现,并可能取决于语言环境(例如,他们可能会被包括在计数或他们可以省略)。
Using this function rather than substr is important when there might be double-width characters in character vectors
使用此功能,而不是substr重要的是,有可能是双宽字符在字符向量
值----------Value----------
A character vector of the same length and with the same attributes as x (after possible coercion).
一个相同的长度和x(后可能强制)相同的属性的特征向量。
Elements of the result will be have the encoding declared as that of the current locale (see Encoding if the corresponding input had a declared encoding and the current locale is either Latin-1 or UTF-8.
当前语言环境(见元素的结果将有编码声明Encoding如果相应的输入有一个声明的编码和当前的语言环境是为Latin-1或UTF-8。
举例----------Examples----------
strtrim(c("abcdef", "abcdef", "abcdef"), c(1,5,10))
转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。
注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
|