Skip to content
Prev 298936 / 398503 Next

How to adjust the start of a series to zero? (i.e. subtract the first value from the sequence)

On Jul 2, 2012, at 2:21 AM, Bert Gunter wrote:

            
That's interesting to me. I almost never use `within`. I'm wondering  
if I'm missing something? As I read the help page `within` is going to  
do something different when the expression is an assignment, so one  
could do the following with `within`

within(dfrm, var2 <- var2/100)

... but that would have no lasting effect since its result was not  
assigned, so I do not se an advantage over:

  dfrm$var2 <- with(dfrm, var2/100)

In both case one would still need to assign the result to an object,  
in the case of the first to 'dfrm' itself and in the second case to  
dfrm[['var2']].

None of the examples on the help page use `within`. Is that because it  
is inferior to transform?
David Winsemius, MD
West Hartford, CT