s-news
[Top] [All Lists]

Allowable names for sapply arguments

To: s-news@lists.biostat.wustl.edu
Subject: Allowable names for sapply arguments
From: Matt Calder <calder@phz.com>
Date: Thu, 29 Nov 2001 10:36:06 -0500 (EST)
Hi,
        This may have been discussed here before, but if not, 

> version
Version 6.0 Release 1 for Sun SPARC, SunOS 5.6 : 2000 
> sapply(1:3, function(x,X) {print(x)}, X=1)
Problem in sapply(1:10, function(x, X): ":" is not a function
        "1" is not a function
        "3" is not a function

Hmm, it looks OK, what could be wrong? 

> sapply(1:3, function(x,y) {print(x)}, y=1)
[1] 1
[1] 2
[1] 3
[1] 1 2 3

Oh! So it is no good to use 'X' as an auxilliary argument to sapply? 

        Matt





<Prev in Thread] Current Thread [Next in Thread>