1
```{r, fig.width=8,fig.height=4}

ggplot(cer12, aes(reorder(Ciudad,-Impactos), Impactos, fill = Marca)) + geom_bar(stat="identity") + theme_minimal() 

ggplot(cer13, aes(reorder(Ciudad,-Impactos), Impactos, fill = Marca)) + geom_bar(stat="identity") + theme_minimal()

ggplot(cer14, aes(reorder(Ciudad,-Impactos), Impactos, fill = Marca)) + geom_bar(stat="identity") + theme_minimal()

ggplot(cer15, aes(reorder(Ciudad,-Impactos), Impactos, fill = Marca)) + geom_bar(stat="identity") + theme_minimal()

```             

I would like to add several charts into one slide (R Markdown Ioslides).

I would also like to create a ToC (R Markdown Ioslides).

Any help please?

Thank you very much

MLavoie
  • 9,671
  • 41
  • 36
  • 56
Pablo Ugarte
  • 35
  • 1
  • 8
  • 2
    Welcome to SO. To get answers, to you should provide a [minimal reproducible example](http://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example#answer-5963610) as asked by the R tag (hover over it under your post). Illustrate your programming problem with regards to the example. – lukeA Dec 22 '16 at 14:23
  • ```{r, fig.width=8,fig.height=4} ggplot(cer12, aes(reorder(Ciudad,-Impactos), Impactos, fill = Marca)) + geom_bar(stat="identity") + geom_text(aes(label=rel.freq), vjust=1.6, color="white", size=3.5) + theme_minimal() + scale_fill_brewer(palette="Dark2") ``` – Pablo Ugarte Dec 22 '16 at 18:21
  • Q1: Try `gridExtra::grid.arrange(ggplot(cer12,...), ggplot(cer13,...), ...)`. Q2: I don't see any TOC options for ioslides (?). #3 Please take the time to read through the above link - providing an appropriate example makes it easier for all. (Your example misses `library(ggplot2)`, `output: ioslides_presentation`, `cer12` and so on...). – lukeA Dec 22 '16 at 20:25
  • Very grateful Next time will provide more clarity around the question e.g. Thanks – Pablo Ugarte Dec 22 '16 at 21:13
  • code formatting – MLavoie Dec 24 '16 at 18:43

1 Answers1

1

Maybe this helps with regards to your first question:

---
output: ioslides_presentation
---
# And now...

## ... Combined plots

```{r fig.height=2}
library(ggplot2)
p <- ggplot(mtcars, aes(wt, mpg))
gridExtra::grid.arrange(
  p + geom_point(),
  p + geom_point(aes(colour = factor(cyl))),
  p + geom_point(aes(shape = factor(cyl))),
  p + geom_point(aes(size = qsec))
)
```

enter image description here

I do not see any options regarding the 2nd question.

lukeA
  • 53,097
  • 5
  • 97
  • 100