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

rmarkdown 3 summary boxes in a row #5

Open
sou863 opened this issue Apr 9, 2024 · 0 comments
Open

rmarkdown 3 summary boxes in a row #5

sou863 opened this issue Apr 9, 2024 · 0 comments

Comments

@sou863
Copy link

sou863 commented Apr 9, 2024

How can I arrange the summary boxes in a row in rmarkdown html file?

#| echo: false
#| label: "Summary boxes"
 
#Get values
totalTransaction <- all_monthly_plotData %>%
  filter(YearMonth == as.Date(format(Sys.Date() - months(1), "%Y-%m-01"))) %>%
  pull(Total_12M_rolling)

digitalTransaction <- all_monthly_plotData %>%
  filter(YearMonth == as.Date(format(Sys.Date() - months(1), "%Y-%m-01"))) %>%
  pull(Digital_12M_rolling)

digitalUptakePercent <- all_monthly_plotData %>%
  filter(YearMonth == as.Date(format(Sys.Date() - months(1), "%Y-%m-01"))) %>%
  pull(`Digital Uptake %`)

#Render summary box
grid.arrange(
   summaryBox("Total Transaction", totalTransaction, width = 3, icon = "fas fa-percent", style = "info"),
   summaryBox("Digital Transaction", digitalTransaction, width = 3, icon = "fas fa-percent", style = "info"),
   summaryBox("Digital Uptake %", digitalUptakePercent, width = 3, icon = "fas fa-percent", style = "info"),
   ncol=3
 )
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

1 participant