Azad Rasul
SmartRS

SmartRS

13- Create a report from data in R programming

13- Create a report from data in R programming

Azad Rasul's photo
Azad Rasul

Published on Jul 21, 2021

1 min read

Subscribe to my newsletter and never miss my upcoming articles

Install and load package (DataExplorer):

#install.packages("DataExplorer")
library(DataExplorer) # load DataExplorer

Download used data LAI_factors.csv and Countries_LAI_and_LST.csv

Read in dataset

dt1<-read.csv(file.path('D:', 'R4Researchers', 'Countries_LAI_and_LST.csv'))
dt2<-read.csv(file.path('D:', 'R4Researchers', 'LAI_factors.csv'))

Create a report

create_report(dt1)
plot_histogram(dt1)

create_report(dt2)
plot_histogram(dt2)

Create a report from 'iris' data

library(datasets)

create_report(iris)
create_report(airquality, y = "Ozone")

Create customized report

# Load library
library(ggplot2) 

create_report(
  data = dt2,
  output_format = html_document(toc = TRUE, toc_depth = 6, theme = "flatly"),
  output_file = "report_LAI_factors.html",
  output_dir = getwd(),
  y = "Year",
  config = configure_report(
    add_plot_prcomp = TRUE,
    plot_qq_args = list("by" = "Year", sampled_rows = 1000L),
    plot_bar_args = list("with" = "LAI_India"),
    plot_correlation_args = list("cor_args" = list("use" = "pairwise.complete.obs")),
    plot_boxplot_args = list("by" = "LST_India"),
    global_ggtheme = quote(theme_light())
  )
)

The output will be saved and opened as html file.

report.png

 
Share this
Proudly part of