xtable
Table## ospreysex fishspp count
## 1 Male Sunfish 59
## 2 Female Sunfish 72
## 3 Male Bass 14
## 4 Female Bass 21
## 5 Male Shad 189
## 6 Female Shad 138
xtable
table with results="asis"
By adding the option results="asis"
to the chunk the table is now rendered into text.
ospreysex | fishspp | count |
---|---|---|
Male | Sunfish | 59 |
Female | Sunfish | 72 |
Male | Bass | 14 |
Female | Bass | 21 |
Male | Shad | 189 |
Female | Shad | 138 |
Use of the align =
option for left, right, and centered cell text. It is simplest to change names outside of the xtable
call.
Sex | Fish Species | Frequency |
---|---|---|
Male | Sunfish | 59 |
Female | Sunfish | 72 |
Male | Bass | 14 |
Female | Bass | 21 |
Male | Shad | 189 |
Female | Shad | 138 |