Displaying 1 result from an estimated 1 matches for "leftcount".
Did you mean:
left_count
2004 Feb 27
0
Re: [R] Is there a way to deactivate partial matching in R?
...ample for dangerous partial list matching
>
> increment.counters <- function(..., mycounters){
+ inclist <- list(...)
+ for (i in seq(along=inclist))
+ mycounters[[names(inclist[i])]] <- mycounters[[names(inclist[i])]] +
inclist[[i]]
+ mycounters
+ }
>
> mycounters <- list(leftcounter=0, rightcounter=0)
> # intended use
> mycounters <- increment.counters(leftcounter=4, mycounters=mycounters)
> mycounters
$leftcounter
[1] 4
$rightcounter
[1] 0
>
> # now let me have a typo
> mycounters <- increment.counters(leftcounte=4, mycounters=mycounters)
> #...