class: inverse, center, middle background-image: url(https://images.unsplash.com/photo-1505765050516-f72dcac9c60e?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=1170&q=80) background-size: cover # Gráficos con ggplot2 <img src="https://ggplot2.tidyverse.org/logo.png" width="135px"/> ### PROYECTO FINAL .large[***Bryan Quispe | Introducción a Rmarkdown con R y Python | 31 May 2022***] --- # Descripción El presente proyecto realizó una presentación usando el paquete ***xaringan*** para mostrar gráficos que se pueden realizar con ***ggplot2.*** --- # geom_bar() Es una de las más sencillas geométricas que posee ggplot2, permitiendo generar gráficos de barras. A continuación se muestra un ejemplo: ```r iris %>% group_by(Species) %>% summarise(petalos=mean(Sepal.Width)) %>% ggplot(aes(x=Species,y=petalos, fill=Species,color=Species))+ geom_bar(stat = "identity", alpha=0.4) + t + scale_xaringan_fill_discrete()+ scale_xaringan_color_discrete() ```  --- # geom_point() Permite crear gráficos de puntos: ```r airquality %>% ggplot(aes(x=Temp,y=Ozone, color=factor(Month)))+ geom_point(size=3.5,alpha=0.4)+theme_minimal() + t ```  --- # geom_line() Permite crear gráficos con lÃneas ```r airquality[airquality$Month=="5",] %>% ggplot(aes(x=Temp,y=Ozone))+ geom_line(size=1.1,alpha=0.4, color="yellow")+theme_minimal() + t ```  --- # geom_boxplot() Permite crear gráficos de cajas ```r airquality %>% ggplot(aes(x=Month,y=Ozone, color=factor(Month), fill=factor(Month)))+ geom_boxplot(alpha=0.4)+theme_minimal() + t ```  --- # Gráficos animados Tambien puede crearse gráficos con movimiento. ```r grafico + labs(title = "Año {frame_time}") + transition_time(year) + t ``` class: center <img src="https://raw.githubusercontent.com/Bryan1qr/RepasoR/main/gif1.gif" width="500px"/> --- # Referencias - <p><cite>Wickham, H. (2016). <em>ggplot2: Elegant Graphics for Data Analysis</em>. Springer-Verlag New York. ISBN: 978-3-319-24277-4. URL: <a href="https://ggplot2.tidyverse.org">https://ggplot2.tidyverse.org</a>.</cite></p> <p><cite>Xie, Y. (2022). <em>xaringan: Presentation Ninja</em>. R package version 0.24. URL: <a href="https://CRAN.R-project.org/package=xaringan">https://CRAN.R-project.org/package=xaringan</a>.</cite></p> --- class: inverse, center, middle # Gracias