> On May 29, 2017, at 1:16 PM, Duncan Murdoch <murdoch.dun...@gmail.com> wrote:
> 
> On 29/05/2017 3:15 PM, Jeff Newmiller wrote:
>> Well, then I will hedge by saying that IN MY OPINION it is an error, because 
>> when it isn't exported the arguments not specified in the generic cannot be 
>> visible for argument completion in editors.
> 
> But that's not true.  If you want the arguments , use
> 
> args(getS3method("predict", class(x)))
> 
> where x is your bs() object.  RStudio appears to make use of something like 
> this.  R.app on MacOS and Rgui on Windows does something different, I think 
> not as effectively.

I think R.app uses rcompgen {utils}. Fortunately a deficit in my aging memory 
was filled in because typing `?completion` brought up the correct help page. I 
was not so lucky in trying to find reference to that function in the R for 
MacOS FAQ.

-- 
David.
> I don't know about other editors.
> 
> (BTW, I think the getS3method function has a bug:  if you change the x object 
> to have class c("foobar", class(x)), it *does* fail, even though predict(x, 
> ...)  will still work.)
> 
> The predict.lm function specifies new data with the newdata argument, while 
> the predict.bs function specifies it with the newx argument. Invoking with 
> the generic is supposed be useful when trying out a variety of models, but 
> being unable to generically specify a data frame (due to the inconsistent 
> naming) blows that strategy to pieces anyway so you might as well be able to 
> call the functions explicitly.
>> 
> 
> In RStudio, if you set x <- bs(1:10), then type
> 
> predict(x,
> 
> and hit TAB, you are offered "object", "newx" and "..." as choices.  On the 
> other editors I mentioned you appear to get a list of argument names for all 
> possible methods regardless of the class of x.
> 
> Duncan murdoch
> 
> ______________________________________________
> R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
> 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.

David Winsemius
Alameda, CA, USA

______________________________________________
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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.

Reply via email to