Table 1

nms <- c("summary", "raw", "design")

list.files(.REPORT_DIR)
RDFILE <- paste0(RDFILE1, ".RData")

load(file.path(.REPORT_DIR, RDFILE))
names(out) <- nms
tab1_lst <- out
sum1 <- tab1_lst$summary
raw1 <- tab1_lst$raw
des1 <- tab1_lst$design
sum1 |> dim()
raw1 |> dim()

## Right order of columns 
sum1 <- sum1 |> select(dat, marg, method, prob, nvar, time)
## sum1 |> print(n=40)

## Wide format to table in paper
sum1_wide <-
    sum1  |>
    pivot_wider(id_cols = c(prob, nvar),
                names_from = c(dat, marg, method),
                values_from = time)

Table 1 - as in paper

sum1_wide  |> 
    kable(full.width=T)  %>%
    kable_styling(bootstrap_options="hover")

Table 1 - long format

sum1 |> 
    kable(full.width=T)  %>%
    kable_styling(bootstrap_options="hover")

Table 1 - raw data

raw1 |>
    kable(full.width=T)  %>%
    kable_styling(bootstrap_options="hover")

Table 1 - graphics

sum1 <-
    transform(sum1, meth_marg=paste0(method,marg,sep = ""))

sum1 |>
    ggplot(aes(x=prob, y=log10(time))) + geom_point() +
    geom_line(aes(group=meth_marg, color=meth_marg)) +
    facet_grid(~ dat)

## sum1 |>
##     ggplot(aes(x=prob, y=log10(time))) + geom_point() +
##     geom_line(aes(group=method, color=method)) +
##     facet_grid(marg ~ dat)


Try the gRim package in your browser

Any scripts or data that you put into this service are public.

gRim documentation built on Oct. 16, 2024, 1:07 a.m.