On Tue, Aug 7, 2012 at 4:28 AM, Liviu Andronic <landronim...@gmail.com> wrote: > On Mon, Aug 6, 2012 at 7:35 PM, Marc Schwartz <marc_schwa...@me.com> wrote: >> is.letter <- function(x) grepl("[[:alpha:]]", x) >> is.number <- function(x) grepl("[[:digit:]]", x) >> > Quick follow-up question. > > I'm always reluctant to create functions that would resemble the > method of a function (here, is() ), but would in fact not be a genuine > method. So would there be any incompatibility between is() and > is.letter(), given that the latter is not a method of the former? > Is it good (or acceptable) practice to define is.letter() as above? > Would is_letter() be better?
It certainly won't cause problems if you never define anything of class "letter" or "number". > > Regards > Liviu > ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.