Table 3

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

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

load(file.path(.REPORT_DIR, RDFILE))
names(out) <- nms
tab5_lst <- out
sum2 <- tab5_lst$summary
raw2 <- tab5_lst$raw
des2 <- tab5_lst$design
sum2 |> dim()
raw2 |> dim()

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

## Wide format to table in paper
sum2_wide <-
    sum2  |>
    arrange(prob, nvar, dat, method)
sum2_wide

sum2_wide <- 
    sum2_wide |> 
    pivot_wider(id_cols = c(marg, nvar, prob),
                names_from = c(method, dat),
                values_from = time)
sum2_wide

Table 3 - as in paper

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

Table 3 - long format

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

Table 3 - raw data

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

Table 3 - graphics

sum2 |>
    ggplot(aes(x=nvar, y=log10(time))) + geom_point() +
    geom_line(aes(group=method, color=method)) +
    facet_grid(prob ~ 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.