Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Output can not be displayed within an Rmarkdown for loop #3

Closed
fb-elong opened this issue Dec 9, 2022 · 1 comment
Closed

Output can not be displayed within an Rmarkdown for loop #3

fb-elong opened this issue Dec 9, 2022 · 1 comment

Comments

@fb-elong
Copy link

fb-elong commented Dec 9, 2022

Below is a reproducible Rmarkdown example.

Here is the current output structure

  htmltools::browsable(
    htmltools::tagList(metalite::meta_run(
      meta,
      var_listing = var_listing,
      download = download,
      type = type))
  )

title: "Untitled"
output: html_document
date: "2022-12-09"

knitr::opts_chunk$set(echo = TRUE)
devtools::load_all()

Not Working

for(i in 1:3){
  x <- metalite_table1(~ SEX | TRT01A, data = r2rtf::r2rtf_adsl, id = "USUBJID")
  print(x)
}

Working

x <- list()
for(i in 1:3){
  x[[i]] <- metalite_table1(~ SEX | TRT01A, data = r2rtf::r2rtf_adsl, id = "USUBJID")
}

htmltools::browsable(htmltools::tagList(x))

Working

x[[1]]
x[[2]]
x[[3]]
@nanxstats
Copy link

It's a frequently asked question: ramnathv/htmlwidgets#110 The short answer is you should just use htmltools::tagList().

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants