>
> > glob2rx("*.xml")
>
> [1] "^.*\\.xml$"
>
> ** **
>
> Bill Dunlap****
>
> Spotfire, TIBCO Software
>
> wdunlap tibco.com
>
> ** **
>
> *From:* Ashwani Rao [mailto:ashwamegh1...@gmail.com]
> *Sen
to
regular expressions.
> glob2rx("*.xml")
[1] "^.*\\.xml$"
Bill Dunlap
Spotfire, TIBCO Software
wdunlap tibco.com
From: Ashwani Rao [mailto:ashwamegh1...@gmail.com]
Sent: Monday, August 12, 2013 10:04 AM
To: William Dunlap
Cc: r-help@r-project.org
Subject: Re: [R] functio
Try changing the assignment to use "<<-"
fileindex <<- fileindex + 1
On Mon, Aug 12, 2013 at 12:44 PM, Ashwani Rao wrote:
> Hi,
>
> Just for fun, I wanted to try function closures.
> Here is simple function definition.
> The following "generateFiles" function return function "fileGen"
Thanks Bill.
Can you please tell me why did you change exp "pattern="*.xml"" to
pattern="\\.xml$".
I know that second one also makes sense.
On Mon, Aug 12, 2013 at 9:59 AM, William Dunlap wrote:
> Change your 'fileIndex <- fileIndex + 1' to 'fileIndex <<- fileIndex + 1'
> so the fileIndex in
Change your 'fileIndex <- fileIndex + 1' to 'fileIndex <<- fileIndex + 1'
so the fileIndex in the environment of the call to generateFiles() is altered
(instead of creating and forgetting about a variable called fileIndex
in the function created by generateFiles.
generateFiles <- function(path,
5 matches
Mail list logo