20190401-R语言提取字符串每个单词的首字母
2019-04-01 本文已影响0人
天空的小白
a<-"What's the fuck"
a<-strsplit(a," ") #拆为单个字符,返回list型
substr(a, start = 1,stop = 1)
a<-unlist(a) #转化为非list型
substr(a, start = 1,stop = 1)
a<-"What's the fuck"
a<-strsplit(a," ") #拆为单个字符,返回list型
substr(a, start = 1,stop = 1)
a<-unlist(a) #转化为非list型
substr(a, start = 1,stop = 1)