首页 > 其他 > 详细

R语言字符串函数

时间:2014-02-04 23:36:21      阅读:519      评论:0      收藏:0      [点我收藏+]

#字符串连接:
paste() #paste(..., sep = " ", collapse = NULL)

#字符串分割:
strsplit() #strsplit(x, split, extended = TRUE, fixed = FALSE, perl = FALSE)

#计算字符串的字符数:
nchar()

#字符串截取:
substr(xstartstop)
substring(textfirstlast = 1000000)
substr(xstartstop) <- value
substring(textfirstlast = 1000000) <- value

#字符串替换及大小写转换:
chartr(oldnewx)
tolower(x)
toupper(x)
casefold(xupper = FALSE)

R语言字符串函数

原文:http://www.cnblogs.com/emanlee/p/3537876.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!