---
title: "Deashboard - RMarkdown"
date: "`r Sys.Date()`"
output:
flexdashboard::flex_dashboard:
orientation: columns
vertical_layout: fill
source: embed
social: menu
---
```{r setup, include=FALSE}
library(flexdashboard)
library(ggplot2)
library(lattice)
library(RColorBrewer)
library(plotrix)
```
# Diagrama de barras {data-icon="fa-chart-bar"}
Column {data-width=333}
-----------------------------------------------------------------------
### Barplot()
```{r barplot}
x <- table(mtcars$cyl)
colores <- c("red","green","yellow")
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="blue") + labs(x="Cilindros",y="Frecuencias",title="Número de Cilindros") + theme_classic()
```
Column {data-width=333}
-----------------------------------------------------------------------
### lattice
```{r}
barchart(x,xlab="Cilindros",ylab="Frecuencias",main="Número de Cilindros",horizontal = FALSE)
```
# Pie {data-icon="fa-chart-pie"}
Column {data-width=500}
-----------------------------------------------------------------------
```{r pie,fig.align='center'}
count <- c(87, 25, 54, 12, 70, 46)
color <- brewer.pal(length(count), "Set2")
pie(count, labels = count, col = color)
```
Column {data-width=500}
-----------------------------------------------------------------------
```{r pie_01,fig.align='center'}
count <- c(56, 32, 45, 63, 74, 125)
pie(count, labels = count, edges = 10)
```
# Pie 3D {data-icon="fa-chart-pie"}
Column {data-width=500}
-----------------------------------------------------------------------
```{r pie_3D,fig.align='center'}
datos <- c(65,35,19,85)
pie3D(datos, labels = datos, explode = 0.25, col = 2:3, labelcol = "black", border = "white")
```
Column {data-width=500}
-----------------------------------------------------------------------
```{r pie_3D_01,fig.align='center'}
datos <- c(45,23,85)
pie3D(datos, labels = datos)
```