Re: [Rd] What do you call the value that represents a missing argument?

From: Vitally S. <spinuvit.list_at_gmail.com>
Date: Sat, 09 Oct 2010 11:33:38 +0200

Hadley Wickham <hadley_at_rice.edu> writes:

> What's the correct way to create an object like this? (for example if
> you are manipulating the formals of a function to add an argument with
> no default value, as in http://stackoverflow.com/questions/3892580/).as.symbol("") returns an error. Both substitute() and bquote() return
> that object, but it's not obvious if this is on purpose.

The question on stackoverflow was concerned with the creation of such an object:

Obvious way:
x <- alist(x=)$x

Because the object like that seems to be a zero length name

as.symbol("") #should be able to produce it

quote() #is another meaningful candidate which does not work

instead substitute() and bquote() works fine. Funny thing is that the behavior of bquote() and quote() are not expected to be different in this case.

Vitally.

>
> Hadley



R-devel_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel Received on Sat 09 Oct 2010 - 09:39:11 GMT

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 Sat 09 Oct 2010 - 12:00:07 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