我尝试使用for循环创建/打印/显示Shiny R表,但是我的for循环不会返回HTML。你能帮助我找出我的for循环有什么问题吗?提前谢谢!
div(style="font-size: 9pt; font-family:calibri;",
tags$table(
tags$caption("Market Split"),
tags$tr(
tags$th(names(dpe1)[1]),
tags$th(names(dpe1)[2])
),
for (i in 1:nrow(dpe1)){
tags$tr(
tags$td(dpe1[i,1]),
tags$td(dpe1[i,2])
)}
))
结果:
<div style="font-size: 9pt; font-family:calibri;">
<table>
<caption>Market Split</caption>
<tr>
<th>Planning.Area</th>
<th>Reporting.Country</th>
</tr>
</table>
</div>
答案 0 :(得分:0)
You can use DT::renderDataTable option--
##output$contents1 <- DT::renderDataTable({
##Create Dataframes using loop
##Show table in main panel using datatable(Dataframe)
##return(Dataframe)##This dataframe you can use in your script for further
use.
## })