Re: [Rd] Syntactically valid names

From: peter dalgaard <pdalgd_at_gmail.com>
Date: Wed, 06 Jul 2011 02:22:04 +0200

On Jul 6, 2011, at 01:40 , Hadley Wickham wrote:

> On Tue, Jul 5, 2011 at 7:31 PM, steven mosher <moshersteven@gmail.com> wrote:

>>  regexp approach is kinda ugly
>> http://www.r-bloggers.com/testing-for-valid-variable-names/

>
> Hmm, I think that suggests a couple of small bug in make.names:
>
>> make.names("...")

> [1] "..."
>> make.names("..1")

> [1] "..1"
>

What's wrong with that? They are names alright, just with special meanings.

> x <- quote(...)
> mode(x)

[1] "name"

> and
>

>> x <- paste(rep("x", 1e6), collapse = "")
>> x == make.names(x)

> [1] TRUE
>
>

Mildly insane, but technically OK, no?

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

-- 
Peter Dalgaard
Center for Statistics, Copenhagen Business School
Solbjerg Plads 3, 2000 Frederiksberg, Denmark
Phone: (+45)38153501
Email: pd.mes_at_cbs.dk  Priv: PDalgd_at_gmail.com

______________________________________________
R-devel_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel
Received on Wed 06 Jul 2011 - 00:58:20 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 Wed 06 Jul 2011 - 08:00:05 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