[Rd] Package install problem in R-devel under Windows

2016-10-21 Thread Henric Winell
Hi, Using the latest R-devel under Windows, I've encountered the following problem when trying to install packages at the prompt: >R CMD INSTALL d:\inum_0.1-0.tar.gz * installing to library 'C:\Users\henwin\R\win-library\3.4' * installing *source* package 'inum' ... ** R ** preparing package f

[Rd] anonymous function parsing bug?

2016-10-21 Thread Wilm Schumacher
Hi, I hope this is the correct list for my question. I found a wired behaviour of my R installation on the evaluation of anonymous functions. minimal working example ### f<-function(x) { print( 2*x ) }(2) class(f) f(3) f<-function(x) { print( 2*x ) }(4)(5) f(6) ### leads to ###

Re: [Rd] anonymous function parsing bug?

2016-10-21 Thread Wilm Schumacher
Hi, sry for the double posting. I forgot to mention that this example ### f<-function(x) { return( 2*x ) }(2) class(f) f(3) f<-function(x) { return( 2*x ) }(4)(5) f(6) ### leads to ## > f<-function(x) { + return( 2*x ) + }(2) > > class(f) [1] "function" > > f(3) [1] 6 > > f<-fu

Re: [Rd] anonymous function parsing bug?

2016-10-21 Thread William Dunlap via R-devel
Here is a simplified version of your problem > { sqrt }(c(2,4,8)) [1] 1.414214 2.00 2.828427 Do you want that to act differently? Bill Dunlap TIBCO Software wdunlap tibco.com On Fri, Oct 21, 2016 at 6:10 AM, Wilm Schumacher wrote: > Hi, > > I hope this is the correct list for my questi

Re: [Rd] anonymous function parsing bug?

2016-10-21 Thread Wilm Schumacher
Hi, thx for the reply. Unfortunately that is not a simplified version of the problem. You have a function, call it and get the result (numeric in, numeric out in that case). For simplicity lets use the "return" case: ## foobar<-function(x) { return(sqrt(x)) }(2) ## which is a function (numeric

Re: [Rd] anonymous function parsing bug?

2016-10-21 Thread luke-tierney
You might find it useful to look at what body() shows you for your example and to think about what return does. Best, luke On Fri, 21 Oct 2016, Wilm Schumacher wrote: Hi, thx for the reply. Unfortunately that is not a simplified version of the problem. You have a function, call it and get th

Re: [Rd] anonymous function parsing bug?

2016-10-21 Thread Wilm Schumacher
Hi, Am 21.10.2016 um 18:10 schrieb William Dunlap: Are you saying that f1 <- function(x) log(x) f2 <- function(x) { log } (x) should act differently? yes. Or more precisely: I would expect that. "Should" implies, that I want to change something. I just want to understand the behavior (

Re: [Rd] anonymous function parsing bug?

2016-10-21 Thread William Dunlap via R-devel
Are you saying that f1 <- function(x) log(x) f2 <- function(x) { log } (x) should act differently? Using 'return' complicates the matter, because it affects evaluation, not parsing. Bill Dunlap TIBCO Software wdunlap tibco.com On Fri, Oct 21, 2016 at 8:43 AM, Wilm Schumacher wrote: > H

Re: [Rd] anonymous function parsing bug?

2016-10-21 Thread William Dunlap via R-devel
Am 21.10.2016 um 18:10 schrieb William Dunlap: > > Are you saying that f1 <- function(x) log(x) f2 <- function(x) { log } (x) should act differently? yes. But that would mean that {log} would act differently than log. I suppose it is a matter of taste, but I say yuck. As for 'return'

Re: [Rd] anonymous function parsing bug?

2016-10-21 Thread peter dalgaard
> On 21 Oct 2016, at 19:17 , Wilm Schumacher wrote: > > Am 21.10.2016 um 18:10 schrieb William Dunlap: >> Are you saying that >>f1 <- function(x) log(x) >>f2 <- function(x) { log } (x) >> should act differently? > yes. Or more precisely: I would expect that. "Should" implies, that I want

Re: [Rd] anonymous function parsing bug?

2016-10-21 Thread luke-tierney
On Fri, 21 Oct 2016, William Dunlap via R-devel wrote: Am 21.10.2016 um 18:10 schrieb William Dunlap: Are you saying that f1 <- function(x) log(x) f2 <- function(x) { log } (x) should act differently? yes. But that would mean that {log} would act differently than log. I suppose it