[Rd] Syntactically valid names

From: Hadley Wickham <hadley_at_rice.edu>
Date: Thu, 30 Jun 2011 15:37:57 -0500


Hi all,

Is there any easy way to tell if a string is a syntactically valid name?

e.g.

is.syntactic("X123")
# TRUE

is.syntactic("[[")
# FALSE
One implementation would be:

is.syntactic <- function(x) x == make.names(x)

but I wonder if there's a more elegant way.

Thanks!

Hadley

-- 
Assistant Professor / Dobelman Family Junior Chair
Department of Statistics / Rice University
http://had.co.nz/

______________________________________________
R-devel_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel
Received on Thu 30 Jun 2011 - 20:41:47 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 Thu 30 Jun 2011 - 23:51:50 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