Monday, 15 August 2011

r - fit an xtable to a pdf file -


I am creating a sweat document that uses the extensible to make the test and puts it in the PDF file. It works but the table document is not suitable and some text is missing. Is there a way to align the text in a PDF file? / P>

This is my data:

  dput (x) structure (list = structure (c (3l, 2l, 1l), label = c ("apersver" , "Db", "web"), class = "factor"), group = structure (c (2l, 1l, 1l) owner = structure (c (1l, 1l, 1l), label. = "Infrastructure", class = "factor"), server = structure (1: 3, .ll = c ("servera", "serverb", "serverc"), class = "factor"), numberconp = c (64 L, 120 L, 120 L), Description = Structure (C (1 L, 3L, 2L), .Label = C ("Front end server for server web traffic", "They B "to create dynamic content", "Customer data and login information"), class = "factor"), cost = structure ("AP", "group", "owner", "server", " Server "," number "," number "," description "," cost "), (" $ 200,000 "," $ 400,000 "," $ 500,000 ", class =" factor "))) , Class = "data.frame", line.Name = c (na, -3l))   

This code is to insert the table into PDF: print (ext. (X, caption = paste ("summary of application"), table. Placement = "! H", caption.placement = "top", align = c ('l', 'p {1.5in}', representative ('c', 6)))

I recommend checking out, many examples are useful, in fact, if you reduce the wire If you do not want to adjust your table, I get two options:

  1. Use small fonts.
  2. Use landscape mode.

    Here, I use a combination of both:

      \ documentclass {article} \ usepackage {rotating} \ begin {document} & lt ; & Lt; Data, echo = FALSE & gt; & Gt; = Library (ext.) X & lt; - Structure (list (app = structure (C (3L, 2L, 1L), .lLL = C ("apserver", "db", "web"), class label = structure (c (2l, 1 L, 1L), .Lale = C ("back", "front"), class = "factor"), owner = structure (C (1L, 1L, 1) LLL = C ("server A" "Serverbie", "serverc", class = "factor"), LLL = "infrastructure", class = "factor"), server = structure (1: 3, number cpu = c (64l, 120l, 120l ), Description = Structure (C (1L, 3L, 2L), .Lll = C ("Front and Head for Server Web Traffic" "," Web Templates To Generate Dynamic Content "," Cost = Structure "(1: 3, .LL = C (" $ 200,000 "," $ 400,000 "," $ 500,000 ", Consumer Data and Login Information Name = c ("app", "group", "owner", "server", "number cpu", "description", "cost"), class = "data.frame", line = name = c , -3 L)) @  gt; = print (ext. (X, caption = paste ("summary of applications"), caption Placement = "top", align = c ('l', 'p {1.5in}', representative ('c', 6)), size = "footnotesize" Floating.environment = "sidewaystable") @ \ & {document}   

    Note that you have to use latex package rotation this should give you something like this :

    Output

No comments:

Post a Comment