私はプロットを表示したり、データフレームを印刷することができるシャイニーのアプリを持っています。それは両方を行いますが、データフレームの最初の10行だけを出力し、 "... 86個の行"を追加します。少なくとも40行のデータフレームを表示したいと思います。 &ヘッド(a、n = 50)の両方を試しましたが、合計で10行しか表示されません。どうすればより多くの行を表示させることができますか?シャイニー:データフレームには10行しか表示されません
あなたの出力はただのdata.frameになるだろうとされていない知っている場合にはこれは私が
server.R
output$IPLMatch2TeamsPlot <- renderPlot({
printOrPlotIPLMatch2Teams(input, output)
})
# Analyze and display IPL Match table
output$IPLMatch2TeamsPrint <- renderPrint({
a <- printOrPlotIPLMatch2Teams(input, output)
head(a,n=50)
#a
})
output$plotOrPrintIPLMatch2teams <- renderUI({
# Check if output is a dataframe. If so, print
if(is.data.frame(scorecard <- printOrPlotIPLMatch2Teams(input, output))){
verbatimTextOutput("IPLMatch2TeamsPrint")
}
else{ #Else plot
plotOutput("IPLMatch2TeamsPlot")
}
})
ui.R
tabPanel("Head to head",
headerPanel('Head-to-head between 2 IPL teams'),
sidebarPanel(
selectInput('matches2TeamFunc', 'Select function', IPLMatches2TeamsFuncs),
selectInput('match2', 'Select matches', IPLMatches2Teams,selectize=FALSE, size=20),
uiOutput("selectTeam2"),
radioButtons("plotOrTable1", label = h4("Plot or table"),
choices = c("Plot" = 1, "Table" = 2),
selected = 1,inline=T)
),
mainPanel(
uiOutput("plotOrPrintIPLMatch2teams")
)
まさに私が欲しかったもの。私はrenderTableとtableOutputを使用し、それは魅力のように機能します!ありがとう! –