Displaying 20 results from an estimated 2000 matches similar to: "printing tabular data nicely"
2013 May 24
2
xtable() with booktabs option problem
I could have sworn that yesterday xtable(file, booktabs = TRUE) was giving me toprule , midrule and bottomrule outout. Today :
library(xtable)
aa <- table( sample(letters[1:9], 100, replace = TRUE))
xtable(aa,
booktabs = TRUE)
gives me
\begin{table}[ht]
\centering
\begin{tabular}{rr}
\hline
& V1 \\
\hline
a & 15 \\
b & 11 \\
c & 13 \\
d &
2012 Feb 07
1
xtable "beta" testing wanted
Dear R-users,
I've enhanced the "xtable" package, adding numerous features that have been requested by users. The changes are listed below.
The objective throughout has been to avoid any breaking changes. However, as "xtable" is widely used and is a dependency of many packages I'd like to have others try it out before I post it to CRAN. Both bug reports and design
2007 Sep 17
1
longtable and Sweave
Dear Sweave-users,
I want to print listing using sweave. Because my tables are very big, I use
the longtable option. But, is it possible to recall the first line of the
table (e.g the colnames line) on each new page ?
Thanks for your help.
Delphine
2009 Jan 07
1
xtable-longtable question
Hello:
I am using Sweave to generate a PDF with figures and tables and was wondering if is possible to carry on table headers and some kind of caption like 'Continued' to the next PDF page when creating long tables.
Felipe D. Carrillo
Supervisory Fishery Biologist
Department of the Interior
US Fish & Wildlife Service
California, USA
2010 Dec 30
1
latex() etc.: How to nicely format a matrix for a LaTeX document?
Dear (T)eXpeRts,
I try to create a LaTeX table from an R matrix for the first time. I am not sure what the "best" approach is, I just read about latex() from Hmisc (toLatex() didn't work).
Consider the following minimal example:
library(Hmisc)
mat <- matrix(c(1,NA,3,100,10000,4), ncol = 3, byrow = TRUE)
latex(mat, file = "", booktabs = TRUE, numeric.dollar = FALSE,
2009 Jan 08
10
help
Hi:
I am going through some of the xtable examples and I can't make the one below work. I need to create a longtable on the fly keeping the column headers for all the pages and I thought this example could give some ideas on how to do it. I am using Sweave and xtable to create my tables and graphics. I wonder if someone could tell me what's wrong. Thanks
## Not run:
\begin{small}
2015 Jun 09
3
Tablas con tabular en latex
Buenos días,
estoy tratando de encontrar la manera de generar tablas en ficheros pdf
(sweave) a través del paquete tables. He mirado que este tema esta activo
en las listas pero no logro localizar las respuestas antes dadas, por eso
lanzo esta consulta.
Mi fichero .rnw tiene el siguiente aspecto:
*******
\documentclass{article}
\usepackage{array,booktabs,caption}
\begin{document}
2004 May 10
4
"#!/usr/bin/R"
Hi all,
Is there any documentation on running R like one would run a shell or
Perl script, with out/input directed appropriately, environment variable
access, and command switch processing?
I looked some, and even remembered to check the FAQ, but couldn't find
anything.
Thanks
W
2009 Sep 27
2
xtable - how to add a "sum of values in a row" column?
Hi,
I saw this example for 2.10 Time series in the xtable gallery documentation.
http://cran.r-project.org/web/packages/xtable/vignettes/xtableGallery.pdf
How would I add a column at the end "Total" which sums the row, with minimal
changes to the code below?
Thanks in advance.
- Ken
2.10 Time series
> temp.ts <- ts(cumsum(1 + round(rnorm(100), 0)), start = c(1954,
+ 7),
2004 Oct 03
3
Making a 'joint distribution'?
Suppose I make two discrete variables --
> D <- data.frame(f1=sample(1:5,100,replace=T), f2=sample(1:5,100,replace=T))
I know I can do:
> table(D$f1, D$f2)
0 1 2 3 4
0 5 5 5 5 4
1 4 2 6 7 3
2 5 3 5 3 6
3 3 1 3 1 2
4 6 4 3 3 6
> table(D$f1)
0 1 2 3 4
24 22 22 10 22
> table(D$f2)
0 1 2 3 4
23 15 22 19 21
which is all great. But how do I produce the
2011 Oct 28
1
xtable with \begin{tabular} and only.contents
I have found that I like having my captions and labels in my latex document
rather than having them contained in my xtable output file (I haven't fully
gone to sweave yet). I know I can do something like this by using the
'only.contents' argument in xtable. Unfortunately, the only.contents
argument also removes the \begin{tabular}{rrrrrr} & \end{tabular} (in the
example below) of
2012 Jul 26
4
Variables in a Tabular form. easily saved in a txt file
Dear all,
I would like to save few variable-names with their values in a tabular form, with that I mean
that files can be printed easily in R in a tabular form and also saved in a ascii file that when one opens it see also the variables in a nice tabular format.
IS that possible? Below a small example of how should look results in R and in a txt file.
Postal Code | Superb
2004 May 10
5
Gmane for list?
Hi all,
I was wondering if I might subscribe this list to gmane.org, so I (and
everyone else) might view and search in with a newsreader?
Also--is there any way to get it indexed by google, maybe along with the
r-help list (or is it already but I haven't found it)?
Thanks for your consideration
W
2004 May 19
4
GUI data browsers
Hi R-helpers,
Does anyone know of a good Tk (or other) script that allows somewhat
intuitive viewing of all of the variables (especially complex lists) in
a session? I would also like to delete, save to file, and rename them
graphically. I would also like a lot of supplemental information like
class, atrributes, names, modes, whatever else...
Context: I am running simulations
2006 Feb 14
1
addmargins
> addmargins(UCBAdmissions, FUN = list(Total=sum))
works with no problems, but consider:
> myFUN <- list(Total=sum)
> addmargins(UCBAdmissions, FUN = myFUN)
Error in "names<-.default"(`*tmp*`, value = "") :
names() applied to a non-vector
Is this a bug?
> R.version
_
platform i386-pc-mingw32
arch i386
os mingw32
system
2006 Jun 21
3
latex function with lm
Dear R People:
I have used the "latex" function from the Hmisc
package and it is just great!
However, I have a new question regarding that function:
is there an option for summary(lm(y~x)), please? There are
options for different types of objects, but I didn't see one
for that. Maybe I just missed it.
Thanks in advance!
R for Windows Version 2.3.1
Sincerely,
Erin Hodgess
2018 Feb 03
2
find unique and summerize
Thank you so much Rui.
1. How do I export this table to excel file?
I used this
tbl1 <- table(Country, IDNum)
tbl2=addmargins(tbl1)
write.xlsx(tbl2,"tt1.xlsx"),sheetName="summary", row.names=FALSE)
The above did not give me that table.
2. I want select those unique Ids that do have records in all countries.
From the above data set, this ID
2006 Jun 29
2
zero.print in print.table after adding margins
The function addmargins() adds margins to a table, but returns a matrix.
But even after converted to a table the print.zero="." option of
print.table() does not work:
> x <- sample( 1:7, 20, replace=T )
> y <- sample( 1:7, 20, replace=T )
> tt <- table( x, y )
> tx <- as.table( addmargins( table( x, y ) ) )
> print( tt, zero.print="." )
y
x 1 2
2006 Jun 29
2
zero.print in print.table after adding margins
The function addmargins() adds margins to a table, but returns a matrix.
But even after converted to a table the print.zero="." option of
print.table() does not work:
> x <- sample( 1:7, 20, replace=T )
> y <- sample( 1:7, 20, replace=T )
> tt <- table( x, y )
> tx <- as.table( addmargins( table( x, y ) ) )
> print( tt, zero.print="." )
y
x 1 2
2013 Apr 10
2
Table with n(%) formatting: A better way to do this?
Hello All,
Am learning to create tables with n(%) formatting using R. Below is a working example. I think this is not bad but wondered if there are better ways of doing it. Although it can be quite humbling, seeing good code helps me assess my progress as an R programmer.
Ultimately want to have code that I can turn into a function. Will then use the output produced to make tables using