Re: [R] Help with non standard evaluation and require function

2016-08-14 Thread Duncan Murdoch
On 14/08/2016 5:23 AM, Luca Cerone wrote: Hi David and Duncan, thanks for your answers! I think what is not clear to me is actually how "substitute" works. Arguments passed to R functions become a special kind of object known as a "promise". Promises contain two things: the expression to ev

Re: [R] Help with non standard evaluation and require function

2016-08-14 Thread peter dalgaard
> On 14 Aug 2016, at 11:23 , Luca Cerone wrote: > > I have no access to my laptop so I can't double check but I think in one of > Wickham's book there was an example like > > f <- function (y) { > substitute (x + y) > } > > f(4) > [1] x + 4 > > i.e. where substitute inside a function was sub

Re: [R] Help with non standard evaluation and require function

2016-08-14 Thread Luca Cerone
Hi David and Duncan, thanks for your answers! I think what is not clear to me is actually how "substitute" works. If I run require (dplyr) or require("dplyr") in the R console everything works as I expect even without the character.only=T (actually because of this I always interpreted that charac

Re: [R] Help with non standard evaluation and require function

2016-08-12 Thread David Winsemius
> On Aug 12, 2016, at 8:57 AM, Luca Cerone wrote: > > Hi everybody, > I am having a hard time in understanding how to deal with non standard > evaluation and the require function. > > I asked about it on Stackoverflow at > http://stackoverflow.com/questions/38922012/r-function-to-install-missin

Re: [R] Help with non standard evaluation and require function

2016-08-12 Thread Duncan Murdoch
On 12/08/2016 11:57 AM, Luca Cerone wrote: Hi everybody, I am having a hard time in understanding how to deal with non standard evaluation and the require function. I asked about it on Stackoverflow at http://stackoverflow.com/questions/38922012/r-function-to-install-missing-packages, below you