1.向量元素可以取字符串值
y<-c("a","b","c","d","e","f","g","k")
2.字符串连接
paste("My","job")
3.字符串实例
1.生成向量X1-X6,自动化完成
sep:a character string to separate the terms
labels<-paste("X",1:6,sep = "")
2.生成1到4的字符串
paste(1:4)
3.连接两个字符串,类似Python中print()
paste("Today is",date())
4.生成小数,以.分隔开
collapse:an optional character string to separate the results.
paste(c("a","b"),collapse = '.')
网友评论