You can also automate it with this:
do.multirow<-function(df, which=1:ncol(df)){
for(c in which){
runs <- rle(as.character(df[,c]))
if(all(runs$lengths>1)){
tmp <- rep("", nrow(df))
tmp[c(1, 1+head(cumsum(runs$lengths),-
1))] <-
paste
You can also automate it with this:
do.multirow<-function(df, which=1:ncol(df)){
for(c in which){
runs <- rle(as.character(df[,c]))
if(all(runs$lengths>1)){
tmp <- rep("", nrow(df))
tmp[c(1, 1+head(cumsum(runs$lengths),-1))] <-
paste(
Thanks a lot Dieter, I'll play a little bit with it. Also thanks for the hint
on how to post a latex reproducible example.
--- On Mon, 1/12/09, Dieter Menne wrote:
> From: Dieter Menne
> Subject: Re: [R] merge table rows (\multirow)
> To: r-help@r-project.org
> Date: M
and
> over. I know this can be done with \multirow if the table is created
> manually. Since this table is created dynamically on the fly I don't know how
> to use \multirow like that. Hope is clear. Thanks
>
>
> --- On Mon, 1/12/09, Dieter Menne wrote:
&g
e:
> From: Dieter Menne
> Subject: Re: [R] merge table rows (\multirow)
> To: r-h...@stat.math.ethz.ch
> Date: Monday, January 12, 2009, 12:41 AM
> Felipe Carrillo yahoo.com>
> writes:
>
> > I need help merging rows.
> > I am trying to merge the 'M
Felipe Carrillo wrote:
>
> I am trying to merge the 'Month' column using \multirow. For example for
> the column 'Week' I want July to be merged into one row(weeks 27,28,29,30)
> and so on for the following weeks.
> Below, I am creating a PDF using Sweave, MikTex,R-2.8.1 and windows XP to
> sho
Felipe Carrillo yahoo.com> writes:
> I need help merging rows.
> I am trying to merge the 'Month' column using \multirow. For example for the
column 'Week' I want July to be
> merged into one row(weeks 27,28,29,30) and so on for the following weeks.
> Below, I am creating a PDF using Sweave, MikT
Hi:
I need help merging rows.
I am trying to merge the 'Month' column using \multirow. For example for the
column 'Week' I want July to be merged into one row(weeks 27,28,29,30) and so
on for the following weeks.
Below, I am creating a PDF using Sweave, MikTex,R-2.8.1 and windows XP to show
an e
8 matches
Mail list logo