所以我刚刚在Shinyapps上部署了我的电影推荐,但仍有一件事我想改变。请看下面的图片。
由于我不想在另一个框中放置“你可能也喜欢这个”,我真的不知道如何以html / css格式调整它。对我来说,它太靠近侧边栏了,我只想在它和侧边栏之间留一些空格。
我的代码:
ui <- shinyUI(dashboardPage(skin="blue",
dashboardHeader(title = "Movies"),
dashboardSidebar(
sidebarMenu(
menuItem(
list(
selectInput("select", label = h5("Select 1 movie you like"),
choices = as.character(movies$title[1:length(unique(movies$movieId))]),
selectize = TRUE,
selected = "Toy Story (1995)"),
submitButton("Done")
)
)
)
),
dashboardBody(
includeCSS("data/custom.css"),
fluidRow(
box(
width=3,
height=400,
status = "primary",
title = "introduction",
textOutput("name1"),
#br(),
imageOutput("myImage",height="300px")
#valueBoxOutput("tableRatings1")
),
box(
width=8,
height=400,
status = "primary",
title = "Plot",
textOutput("des1"),
br(),
h4("Ratings"),
br(),
valueBoxOutput("tableRatings1")
)
),
fluidRow(
h4("You might also like this"),
box(
width=2,
height=220,
status = "danger",
imageOutput("myImage1",height="150px"),
textOutput("myreco1")
#textOutput("myrate1")
),
box(
width=2,
height=220,
status = "danger",
imageOutput("myImage2",height="150px"),
textOutput("myreco2")
#textOutput("myrate2")
),
box(
width=2,
height=220,
status = "danger",
imageOutput("myImage3",height="150px"),
textOutput("myreco3")
#textOutput("myrate3")
),
box(
width=2,
height=220,
status = "danger",
imageOutput("myImage4",height="150px"),
textOutput("myreco4")
#textOutput("myrate4")
),
box(
width=2,
height=220,
status = "danger",
imageOutput("myImage5",height="150px"),
textOutput("myreco5")
#textOutput("myrate5")
)
)
)
)
)
顺便说一句,我的shinyapps现在跑得很慢,我不知道为什么。它过去运行得更快。此应用程序目前仅需4小时。如果我使用免费计划,每个应用程序有25个小时吧?
答案 0 :(得分:2)
Private Sub CommandButton1_Click()
Dim ws As Worksheet
Dim lastRow As Long
Application.ScreenUpdating = False
Set ws = ThisWorkbook.Sheets("Sheet1")
With ws
lastRow = .Cells(.Rows.Count, "B").End(xlUp).Row
.Range("P2").Formula = "=IF(MOD(SUMPRODUCT(($B$2:$B2=B2)*($K$2:$K2=K2)),3)=1,1,0)"
.Range("P2").AutoFill Destination:=.Range("P2:P" & lastRow)
.Range("P2:P" & lastRow).Value = .Range("P2:P" & lastRow).Value
.Range("F2").Formula = "=IF"
End With
Application.ScreenUpdating = True
End Sub