如何从R中的字符串中提取字符?
我们可以在stringi包中使用stri_sub函数。
示例
> x<- "nhooo is the largest online library for best tutorials" > x [1] "nhooo is the largest online library for best tutorials" > library(stringi) > stri_sub(x,1,9) [1] "Tutorials" > stri_sub(x,1,-20) [1] "nhooo is the largest online library" > stri_sub(x,-14,-1) [1] "best tutorials" > stri_sub(x,-41,-1) [1] "largest online library for best tutorials"
热门推荐
4 薛之谦祝福语简短
10 阳历新年祝福语大全 简短
11 收到公公生日祝福语简短
12 送给同桌的祝福语简短
13 给导师送花祝福语简短
14 幼儿节日祝福语大全简短
15 祝福语年轻回复文案简短
16 给老板祝福语简短精辟
17 上级买车祝福语大全简短
18 关于扬州的祝福语简短