Mdhale
Mdhale

Reputation: 885

Quarto file not producing data table

I am trying to create an markdown document using it. Everything works well except I am not able to render tables on the output HMTL file. The following is my code. The HTML document shows :: {.cell-output-display} where the table is supposed to be rendered. Can you help me out with this?

process_results <- function(value){
    results <- topTable(fit2, coef=value,n=Inf,sort.by = 'p') 
    top_results <- head(results, n = 10) %>%
    kable(caption = value) %>%     ### This works on traditional mardown. 
    kable_styling()
    ...........
    ..............
}    
 


 process_results('GroupB_vs_GroupA')

Upvotes: 2

Views: 1140

Answers (1)

Richard Careaga
Richard Careaga

Reputation: 670

The function doesn't return a value is the problem.

library(kableExtra)
process_results <- function(value){
    #results <- topTable(fit2, coef=value,n=Inf,sort.by = 'p') 
    top_results <- head(mtcars, n = 10) %>%
    kable(caption = value) %>%     ### This works on traditional mardown. 
    kable_styling()
    return(top_results)
}
process_results('GroupB_vs_GroupA')

Upvotes: 1

Related Questions