Skip to content
Prev 67476 / 398506 Next

removing characters from a string

On Tue, 2005-04-12 at 05:54 -0700, Vivek Rao wrote:
Something like the following should work:
collapse = "")
[1] "QvuuAlSJYUFpUpwJomtCir8TfvNQyV6O7W7TlXSXlLHocCdtnV"
[1] "8677"

The use of gsub() here replaces any characters NOT in 0:9 with a "",
therefore leaving only the digits.

See ?gsub for more information.

HTH,

Marc Schwartz