Re: [R] using reserved words in R, and reuse variable names in different functions

2013-03-04 Thread MacQueen, Don
Yes, it can cause problems. And speaking for myself, I'd say it's not worth the risk, because it's easy enough to find alternative variable names that are close enough to the notation of your formulas that remembering should be no problem. For example, "tt", "cc", and "mmatrix" might do it. -Don

Re: [R] using reserved words in R, and reuse variable names in different functions

2013-03-02 Thread Rolf Turner
Well *I* think it should be a fortune! cheers, Rolf On 03/03/2013 10:30 AM, Peter Ehlers wrote: Duncan's comment may not qualify as a fortune, but it did make me chuckle. Peter Ehlers On 2013-03-02 03:01, Duncan Murdoch wrote: On 13-03-01 8:35 PM, C W wrote: [...snip...] pi

Re: [R] using reserved words in R, and reuse variable names in different functions

2013-03-02 Thread Peter Ehlers
Duncan's comment may not qualify as a fortune, but it did make me chuckle. Peter Ehlers On 2013-03-02 03:01, Duncan Murdoch wrote: On 13-03-01 8:35 PM, C W wrote: [...snip...] pie is a function, but all it does is draw pie charts, so who cares if you mask it? :-). Duncan Murdoch [...snip.

Re: [R] using reserved words in R, and reuse variable names in different functions

2013-03-02 Thread Duncan Murdoch
ch 02, 2013 5:01 AM To: Sarah Goslee Cc: r-help Subject: Re: [R] using reserved words in R, and reuse variable names in different functions On 03/02/2013 01:12 PM, Sarah Goslee wrote: On Fri, Mar 1, 2013 at 7:06 PM, C W wrote: Thanks, that was just an example I came up with. I was just cu

Re: [R] using reserved words in R, and reuse variable names in different functions

2013-03-01 Thread C W
meone has used for a function. > > Bill Dunlap > Spotfire, TIBCO Software > wdunlap tibco.com > > > > -Original Message- > > From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] > On Behalf > > Of Rolf Turner > > Sent: Sa

Re: [R] using reserved words in R, and reuse variable names in different functions

2013-03-01 Thread William Dunlap
sage- > From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On > Behalf > Of Rolf Turner > Sent: Saturday, March 02, 2013 5:01 AM > To: Sarah Goslee > Cc: r-help > Subject: Re: [R] using reserved words in R, and reuse variable names in > different >

Re: [R] using reserved words in R, and reuse variable names in different functions

2013-03-01 Thread Rolf Turner
On 03/02/2013 01:12 PM, Sarah Goslee wrote: On Fri, Mar 1, 2013 at 7:06 PM, C W wrote: Thanks, that was just an example I came up with. I was just curious if using same variable names in different functions would cause problems. No. The environment of a function is independent of other functi

Re: [R] using reserved words in R, and reuse variable names in different functions

2013-03-01 Thread Sarah Goslee
On Fri, Mar 1, 2013 at 7:06 PM, C W wrote: > Thanks, that was just an example I came up with. I was just curious if > using same variable names in different functions would cause problems. No. The environment of a function is independent of other functions. > Especially with reserved words. Y

Re: [R] using reserved words in R, and reuse variable names in different functions

2013-03-01 Thread C W
Thanks, that was just an example I came up with. I was just curious if using same variable names in different functions would cause problems. Especially with reserved words. Mike On Fri, Mar 1, 2013 at 5:45 PM, David Winsemius wrote: > > On Mar 1, 2013, at 1:56 PM, C W wrote: > > > Hi list, >

Re: [R] using reserved words in R, and reuse variable names in different functions

2013-03-01 Thread David Winsemius
On Mar 1, 2013, at 1:56 PM, C W wrote: > Hi list, > I am writing several functions and running out variable names. I am using > words such as "t", "c", "matrix" to keep the notation same as formulas I am > using. > > For example I have, > > unnormalized <- function(t, x, y){ >val <- rnorm(

[R] using reserved words in R, and reuse variable names in different functions

2013-03-01 Thread C W
Hi list, I am writing several functions and running out variable names. I am using words such as "t", "c", "matrix" to keep the notation same as formulas I am using. For example I have, unnormalized <- function(t, x, y){ val <- rnorm(t, mean=x, var=y) return(val) } metropolis <- functio