Center for Customer Insights and Digital Marketing

Create an Analytics Report Directly from R

Create a Great Report with R Markdown

The Center for Customer Insights and Digital Marketing presents a workshop on how to create a great report directly from R using the R Markdown package featuring Matheus Cordeiro, the junior data scientist. In this video, he provides live tutorials on what R markdown exactly is, what the benefits of using R markdown are, creating and comparing various types of reports (i.e., HTML, PDF, Word), and other important details that will allow you to create a successful report with R Markdown. 

If you haven’t installed R or R Studio yet, click here to learn how!

Learning Outcomes

  1. Describe the R Markdown Structure
  2. Explain capabilities and benefits of using R markdown
  3. Compare and contrast creating PDF and HTML reports
  4. Create output header appropriate for desired output file type
  5. Explain R Markdown code structure
  6. Create a report in desired file format (i.e., HTML, PDF, and Word) using R Markdown

Check below to view the video!

Relevant Links and Code:

install.packages('tinytex')

tinytex::install_tinytex()

install.packages()

https://1.bp.blogspot.com/-Zc0T3aW4dNQ/Xa0i7XZFxYI/AAAAAAABXtk/LqZeCUGelnEFYYBAMah9aVjKTlDqpnahgCLcBGAsYHQ/s1600/98e23a08a6efb8d2de098595b156fcb61306eb19.jpg

df_corr <- round(cor(mtcars),2)

library(reshape)

melted_corr <- melt(df_corr)

library(ggplot2)

ggplot(data = melted_corr, aes(x=X1, y=X2, fill=value)) + 

  geom_tile(color = "white")+

 scale_fill_gradient2(low = "blue", high = "red", mid = "white", 

   midpoint = 0, limit = c(-1,1), space = "Lab", 

   name="Correlation Scale") + 

geom_text(aes(X1, X2, label = value), color = "black", size = 4)

ggplot(mtcars, aes(x=wt, y=mpg)) +

  geom_point() +  geom_smooth(method=lm, se=FALSE)

ggplot(mtcars, aes(x=disp, y=wt)) +

  geom_point() +  geom_smooth(method=lm, se=FALSE)

{.tabset .tabset-dropdown}

https://rmarkdown.rstudio.com/

https://www.linkedin.com/in/matheus-cordeiro-garcia/

https://www.rstudio.com/

Supplementary Video on How to Install R and RStudio:

https://www.cpp.edu/cba/customer-insights-lab/news/event/install-r.shtml