Last active
October 5, 2016 19:12
-
-
Save oganm/abef941dd42934b5ec4a35adc6b86850 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
title: "Quicky and dirty: side-by-side plot and table" | |
author: "Omar AlOmeir" | |
output: | |
github_document | |
--- | |
```{r} | |
library(ggplot2) | |
suppressMessages(library(dplyr)) | |
#devtools::install_github("jennybc/gapminder") | |
library("gapminder") | |
gtbl <- tbl_df(gapminder) | |
``` | |
<table> | |
<tr> | |
<th> | |
```{r results = 'asis', echo=FALSE} | |
tbl1 <- gtbl %>% | |
group_by(continent) %>% | |
summarise_each(funs(mean, median), gdpPercap) | |
knitr::kable(tbl1,'html') | |
``` | |
</th> | |
<!-- | |
```{r plotOuter,echo=FALSE} | |
ggplot(gtbl, aes(x = continent, y = gdpPercap, color = continent)) + | |
geom_point() + ggtitle("GDP per cap by continent") | |
``` | |
--> | |
<th> | |
<img src="hede_files/figure-markdown_github/plotOuter-1.png" style="width:304px;height:228px;"> | |
</th> | |
</tr> | |
</table> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment