Bar_Charts_01

Column

barplot

Column

ggplot2

Column

lattice

Bar_Charts_02

Column

mtcars_cyl

Column

mtcars_gear

Bar_Charts_03

mtcars_gear

---
title: "Bar Charts"
output: 
  flexdashboard::flex_dashboard:
    orientation: columns
    vertical_layout: fill
    theme: united
    social: ['facebook','twitter','linkedin']
    source: embed
---

```{r setup, include=FALSE}

library(ggplot2)

library(lattice)

library(flexdashboard)
```


# Bar_Charts_01 {data-icon=fa-bar-chart}


Column {data-width=333}
-----------------------------------------------------------------------


### barplot

```{r}
x <- table(mtcars$cyl)

colores <- c("orange","blue","purple")

barplot(x,xlab="Cilindros",ylab="Frecuencias",main="Número de Cilindros",col=colores)

```

Column {data-width=333}
-----------------------------------------------------------------------

### ggplot2

```{r}
ggplot(mtcars,aes(cyl)) + geom_bar(fill=colores) + labs(x="Cillindros",y="Frecuencias",title="Número de Cilindros") + theme_dark()

```

Column {data-width=333}
-----------------------------------------------------------------------


### lattice

```{r}

barchart(x,xlab="Cilindros",ylab="Frecuencias",main="Número de Cilindros",col=colores,horizontal=FALSE)


```



# Bar_Charts_02 {data-icon=fa-bar-chart}


Column {data-width=500}
-----------------------------------------------------------------------

### mtcars_cyl

```{r}
x <- table(mtcars$cyl)

colores <- c("orange","blue","purple")

barplot(x,xlab="Cilindros",ylab="Frecuencias",main="Número de Cilindros",col=colores)


```


Column {data-width=500}
-----------------------------------------------------------------------


### mtcars_gear

```{r}
y <- table(mtcars$gear)

par(mfrow=c(1,2))

barplot(x,xlab="Cilindros",ylab="Frecuencias",main="Número de Cilindros",col=colores)

barplot(y,xlab="Engranajes",ylab="Frecuencias",main="Número de Engranajes",col=rainbow(3))

```




# Bar_Charts_03 {data-icon=fa-bar-chart}

### mtcars_gear

```{r}
y <- table(mtcars$gear)

par(mfrow=c(1,2))

barplot(x,xlab="Cilindros",ylab="Frecuencias",main="Número de Cilindros",col=colores)

barplot(y,xlab="Engranajes",ylab="Frecuencias",main="Número de Engranajes",col=rainbow(3))

```