## ----include = FALSE----------------------------------------------------------
knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>"
)

## ----echo=FALSE, message=FALSE, warning=FALSE, results='hide'-----------------
library(metaConvert)
library(DT)

## ----eval = FALSE-------------------------------------------------------------
# see_input_data(measure = "or")

## ----echo=FALSE---------------------------------------------------------------
DT::datatable(see_input_data(measure = "or", type_of_measure = "natural", extension="data.frame"), options = list(  
    scrollX = TRUE,
    dom = c('t'),
    scrollY = "300px", 
    pageLength = 500,
    ordering = FALSE,
    rownames = FALSE,
    columnDefs = list(
                  list(width = '130px',
                       targets = "_all"),
                  list(className = 'dt-center', 
                                     targets = "_all"))))

## ----eval = FALSE-------------------------------------------------------------
# data_extraction_sheet(measure = "or")

## ----echo=FALSE---------------------------------------------------------------
DT::datatable(data_extraction_sheet(measure = "or", extension="data.frame"), options = list(  
    scrollX = TRUE,
    dom = c('t'),
   ordering = FALSE,
    rownames = FALSE,
    columnDefs = list(
                  list(width = '130px',
                       targets = "_all"),
                  list(className = 'dt-center', 
                                     targets = "_all"))))

## ----message=FALSE, fig.width= 11---------------------------------------------
compare_df(
    df_extractor_1 = df.compare1,
    df_extractor_2 = df.compare2,
    output = "html")

## ----message=FALSE, fig.width= 11---------------------------------------------
compare_df(
    df_extractor_1 = df.compare1,
    df_extractor_2 = df.compare2,
    ordering_columns = c("author", "year"),
    output = "html")

## ----message=FALSE------------------------------------------------------------
res = convert_df(x = df.short, measure = "g")

## ----eval= FALSE--------------------------------------------------------------
# summary(res)

## ----echo=FALSE---------------------------------------------------------------
DT::datatable(summary(res), options = list(  
    scrollX = TRUE,
    dom = c('t'),
    ordering = FALSE,
    rownames = FALSE,
    scrollY = "300px", 
    pageLength = 100,
    columnDefs = list(
                  list(width = '130px',
                       targets = "_all"),
                  list(className = 'dt-center', 
                                     targets = "_all"))))

## ----message=FALSE------------------------------------------------------------
res_rd <- convert_df(df.haza, measure = "rd")
head(summary(res_rd)[, c("row_id", "es_crude", "se_crude",
                         "es_ci_lo_crude", "es_ci_up_crude", "info_used_crude")])

## ----message=FALSE------------------------------------------------------------
res_flags <- convert_df(df.short, measure = "g")
s_flags <- summary(res_flags, flags = TRUE, guidance = TRUE)
head(s_flags[, c("row_id", "es_crude", "info_used_crude",
                 "flags_crude", "es_guidance_crude")])

## ----message=FALSE------------------------------------------------------------
# Observed correlation with known scale reliabilities
es_disattenuate(r = 0.45, r_se = 0.08,
                reliability_x = 0.82, reliability_y = 0.78)

## -----------------------------------------------------------------------------
sem_res <- compute_sem(sd = 10, icc = 0.85, n_sample = 100)
sdc_res <- compute_sdc(sem = sem_res$sem, sem_se = sem_res$sem_se)
sem_res
sdc_res

