rstudio / rstudio/flexdashboard

Build a page via loop

Open
#80 10 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
848
Forks
298
PR merge metrics
No merged PRs in 30d

Description

Is it possible to dynamically build a page using a loop? I've tried the approach below in an 'asis' block, but it doesn't seem to work.

cat(title, ' {data-icon="fa-line-chart"}\n')
cat("=====================================\n")
cat('\n')

for (i in seq_along(fields)) {
  if (i %% col_no != 0) {
    cat("Row\n")
    cat("-------------------------------------\n")
    cat('\n') 
  }

  cat("### ", fields[[i]], "\n")
  cat('\n')

  create_plot(fields[i])
  cat('\n')
}

There's a similar question on Stack Overflow.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

No files or tests are named. Reproduce the R loop in issue #80 and compare its generated markdown and plot output with the linked Stack Overflow example; done means establishing whether loop-built pages are supported and recording a confirmed usage pattern or limitation.

Written by the indexing model from the issue text.

Assessment

Tech stack
r
Domain
frontend, web-dev
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.