Modérateur : Groupe des modérateurs
Code : Tout sélectionner
> data(tli)
> tli.table <- xtable(tli[1:20,], align = c(" c ", " >{ \\columncolor{yellow}} c <{} ", " c ", " c ", " c ", " c "))
> print(tli.table, add.to.row=list(pos = list(4), command = "\\rowcolor{yellow}"))
% latex table generated in R 2.13.1 by xtable 1.5-6 package
% Wed Aug 10 10:27:50 2011
\begin{table}[ht]
\begin{center}
\begin{tabular}{ c >{ \columncolor{yellow}} c <{} c c c c }
\hline
& grade & sex & disadvg & ethnicty & tlimth \\
\hline
1 & 6 & M & YES & HISPANIC & 43 \\
2 & 7 & M & NO & BLACK & 88 \\
3 & 5 & F & YES & HISPANIC & 34 \\
4 & 3 & M & YES & HISPANIC & 65 \\
\rowcolor{yellow}5 & 8 & M & YES & WHITE & 75 \\
6 & 5 & M & NO & BLACK & 74 \\
7 & 8 & F & YES & HISPANIC & 72 \\
8 & 4 & M & YES & BLACK & 79 \\
9 & 6 & M & NO & WHITE & 88 \\
10 & 7 & M & YES & HISPANIC & 87 \\
11 & 3 & M & NO & WHITE & 79 \\
12 & 6 & F & NO & WHITE & 84 \\
13 & 8 & M & NO & WHITE & 90 \\
14 & 5 & M & NO & WHITE & 73 \\
15 & 8 & F & NO & WHITE & 72 \\
16 & 6 & F & NO & BLACK & 82 \\
17 & 4 & M & NO & WHITE & 69 \\
18 & 3 & F & YES & HISPANIC & 17 \\
19 & 3 & M & NO & HISPANIC & 37 \\
20 & 5 & M & NO & WHITE & 70 \\
\hline
\end{tabular}
\end{center}
\end{table}
Code : Tout sélectionner
data(tli)
library(xtable)
tli.table <- xtable(tli[1:20,],
align = c(" c ", " >{ \\columncolor{yellow}} c <{} ", " c ", " c ", " c ", " c "))
print(tli.table, type = "html", add.to.row=list(pos = list(4), command = "\\rowcolor{yellow}"))
Retourner vers « Questions en cours »
Utilisateurs parcourant ce forum : Google [Bot] et 0 invité