[Rd] "\examples" section for "base/man/replace.Rd"

Timothy Bates timothy.c.bates at gmail.com
Mon Aug 15 19:08:02 CEST 2011


There is no usage example for replace(). Here is a patch to replace.Rd that offers one.


# Clean up a vector of text answers
foo <- c("Yes”, "n”, "no answer")
foo <- replace(foo, list=c(2, 3), values=c("No”, NA))
foo 
# "Yes" "No”  NA


diff attached
best wishes,
tim




More information about the R-devel mailing list