0

The question was phrased weirdly, but I'll try my absolute best to explain it thoroughly.

I have a data frame that was constructed from a time series object. The time series object was constructed like so:

std<- ts(baser, frequency=12, start=c(1987,1))

And the data.frame that was built from this previous ts object was built like so:

 meses<- c("Enero","Febrero","Marzo","Abril","Mayo","Junio","Julio","Agosto","Septiembre","Octubre","Noviembre","Diciembre")
 td<- ts2df(std,mon1=1)
names(td)<-meses

Note that the function ts2df is not a part of core R, but taken from the package 'wq' This obviously forces me to create a vector of names that will be coerced into the name of the data frame (here, in spanish).

The resulting data.frame is naturally large, with 12 columns (with names), and enough rows for every eyar from 1987 to 2013.

The summary function for this data.frame is expressed in the same format (same number of columns), with 6 rows.

I need to export this summary with LaTeX formatting, but the table is (naturally) too long. The package xtable allows to do this, but still keeps the table with 12 columns wide. The most symmetrical would be to get the summary with 6 columns: The months from January to June, the summary statistics below them. And below those, again the remaining months (July to December), with their respective statistics underneath.

I am willing and able to modify any steps in order to get what I need, if the solution is easier in any of them.

erasmortg
  • 3,246
  • 1
  • 17
  • 34
  • 1
    What's wrong with `xtable(td[,1:6])` and `xtable(td[,7:12])`? – MrFlick Jun 03 '14 at 19:49
  • @MrFlick by itself nothing, this solves it. I was looking for a more concise solution, as I have to present my code and commenting how the table has to be modified in order to present it as one instead of two would be slightly unpalatable. – erasmortg Jun 03 '14 at 20:31
  • 1
    Then I don't understand what other types of solutions you are looking for. You could format your LaTeX document in a landscape orientation (outside of R). – MrFlick Jun 03 '14 at 20:33

0 Answers0