new sep argument for interaction (was: Re: [R] Concatenating variables)

Gabor Grothendieck ggrothendieck at myway.com
Thu Aug 5 02:15:25 CEST 2004


Deepayan Sarkar <deepayan <at> stat.wisc.edu> writes:

: 
: On Wednesday 04 August 2004 15:50, Gabor Grothendieck wrote:
: 
: > Several people have already mentioned paste, which returns a
: > character result, and two other solutions, depending on what you are
: > looking for, are:
: >
: >    with(tenn, 100 * up + 10 * down + stable)  # numeric result
: >
: >    with(tenn, interaction(up, down, stable, sep =""))  # factor
: > result
: 
: Except that interaction doesn't have a sep= argument. 

The interaction in Hmisc has a sep= argument.  (I did ?interaction before
posting but forgot that I had Hmisc loaded and did not notice that I was
looking at the help for Hmisc interaction rather than the base interaction.)

Thus, just to be definite, the above should have been:

  require(Hmisc)
  with(tenn, interaction(up, down, stable, sep = ""))




More information about the R-help mailing list