Lepaskan semua ruang whits trailing r

x = "   string   "
trimws(x)
x
# [1] "string"
marcofaga