Still not sure whether I understand right but I give it a shot.
The most important assumption I'm making here is that your multicolumn rows in that template are always at the same spot. You use R to create a matrix or dataframe with no (useful) data in these rows.
For the purpose of this example, the multicolumn rows are 15, 30 and 60 of a dataframe of 80 rows, corresponding to your template of 80 rows.
What you could do: In R
, eliminate those NA rows entirely, so that our dataframe now has only 77 rows.
You insert empty rows for your template via xtable
with
> addtorow <- list()
> addtorow$pos <- list()
> addtorow$pos[[1]] <- c(14,29,59)
> addtorow$command <- "\\\\ \n"
> print( xtable( o ), add.to.row = addtorow, include.rownames=FALSE )
That should give you empty lines, no &
but with \\
and thus be what you are looking for?