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

From: Timothy Bates <timothy.c.bates_at_gmail.com>
Date: Mon, 15 Aug 2011 18:08:02 +0100

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,

R-devel_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel Received on Mon 15 Aug 2011 - 17:08:32 GMT

This quarter's messages: by month, or sorted: [ by date ] [ by thread ] [ by subject ] [ by author ]

All messages

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Tue 16 Aug 2011 - 16:20:20 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-devel. Please read the posting guide before posting to the list.

list of date sections of archive