替换字符串中第一个字符后的所有字符
答
我认为这会为你工作:
> substring("hello", 1, 1)
[1] "h"
我知道你问了一个使用'gsub'的方法,但为什么不'substr(x,start = 1,stop = 1)'? – svenhalvorson