[英]how setting orientation _sidebarPanel_ in Shiny in R?
I'm working with '''shiny'''.我正在使用'''闪亮的'''。 but I have a problem with the orientation of information when I run shiny.但是当我运行 shiny 时,我的信息方向有问题。 ('''sidebarPanel'''). ('''sidebarPanel''')。 When I run my code it shows a vertical parameter column.当我运行我的代码时,它会显示一个垂直参数列。 So is too big and it is no possible to see the rest of information.所以太大了,看不到rest的信息。 I would like that the parameter column was horizontal but I could not achieve it.我希望参数列是水平的,但我无法实现。
AedesIbag_model<-function(t, y, p) {
with(as.list(c(y, p)), {
dL = R*theta*S - mu_L*L - gamma_L*L - mu_w*L
dP = gamma_L*L - mu_P*P - gamma_P*P - mu_w*P
dA = gamma_P*P - mu_A*A
dD = beta - alpha*D
list(c(L=dL, P=dP, A=dA, D=dD))
})
}
server <- function(input, output) {
output$AedesIbag_model <- renderPlot({
y0 <- c(L=input$L, P=input$P, A=input$A, D=input$D)
parms <- c(R=0.24, theta=input$theta,S=input$S,
gamma_L=0.2088, gamma_P=0.384,
beta=input$beta,
mu_L=0.0105, mu_P=0.01041, mu_A=0.091,
mu_w=input$mu_w,
alpha=input$alpha)
times <- seq(0, 100, 0.1)
out_1 <- ode(y0, times, AedesIbag_model, parms)
par(mfrow=c(2, 1))
matplot.0D(out_1, main="time")
plot(out_1[,2:3], type="l", xlab="L", ylab="D", main="state diagram")
})
}
ui <- fluidPage(
headerPanel("AedesIbag_model"),
sidebarLayout(
sidebarPanel(
h3("Init values"),
numericInput("L", label = "L",
min = 0.0, max = 2000, value = 1000, step = 100, width=100),
numericInput("P", label = "P",
min = 0.0, max = 1000, value = 800, step = 10, width=100),
numericInput("A", label = "A",
min = 0.0, max = 500, value = 100, step = 10, width=100),
numericInput("D", label = "D",
min = 0.0, max = 100, value = 10, step = 5, width=100)
),
fluidRow(
column(
h3("Parameters"),
numericInput("R", label = "R",
min = 0.0, max = 1, value = 2.4, step = 0.1, width=100),
numericInput("theta", label = "theta",
min = 0.0, max = 5, value = 3, step = 0.2, width=100),
numericInput("S", label = "S",
min = 100, max = 5000, value = 1800, step = 100, width=100),
numericInput("gamma_L", label = "gamma_L",
min = 0.2088, max = 0.2088, value = 0.2088, step = 0, width=100),
numericInput("gamma_P", label = "gamma_P",
min = 0.384, max = 0.384, value = 0.384, step = 0, width=100),
numericInput("beta", label = "beta",
min = 0.0, max = 1000, value = 10, step = 10, width=100),
numericInput("mu_L", label = "mu_L",
min = 0.0105, max = 0.0105, value = 0.0105, step = 0, width=100),
numericInput("mu_P", label = "mu_P",
min = 0.01041, max = 0.01041, value = 0.01041, step = 0, width=100),
numericInput("mu_A", label = "mu_A",
min = 0.091, max = 0.091, value = 0.091, step = 0, width=100),
numericInput("mu_w", label = "mu_w",
min = 0.0, max = 1, value = 0.1, step = 0.1, width=100),
numericInput("alpha", label = "alpha",
min = 0.0, max = 1000, value = 10, step = 10, width=100)
)
)
),
mainPanel(h3("Simulation results"),
plotOutput("AedesIbag_model")
)
)
shinyApp(ui = ui, server = server)
```
Perhaps you are looking for this:也许您正在寻找这个:
ui <- fluidPage(
headerPanel("AedesIbag_model"),
sidebarLayout(
sidebarPanel(
h3("Init values"),
numericInput("L", label = "L",
min = 0.0, max = 2000, value = 1000, step = 100, width=100),
numericInput("P", label = "P",
min = 0.0, max = 1000, value = 800, step = 10, width=100),
numericInput("A", label = "A",
min = 0.0, max = 500, value = 100, step = 10, width=100),
numericInput("D", label = "D",
min = 0.0, max = 100, value = 10, step = 5, width=100)
),
fluidRow(h3("Parameters"),
column(2, numericInput("R", label = "R",
min = 0.0, max = 1, value = 2.4, step = 0.1, width=100)
),
column(2, numericInput("theta", label = "theta",
min = 0.0, max = 5, value = 3, step = 0.2, width=100)
),
column(2,numericInput("S", label = "S",
min = 100, max = 5000, value = 1800, step = 100, width=100)
),
column(2, numericInput("gamma_L", label = "gamma_L",
min = 0.2088, max = 0.2088, value = 0.2088, step = 0, width=100)
),
column(2, numericInput("gamma_P", label = "gamma_P",
min = 0.384, max = 0.384, value = 0.384, step = 0, width=100)
),
column(2, numericInput("beta", label = "beta",
min = 0.0, max = 1000, value = 10, step = 10, width=100)
),
column(2, numericInput("mu_L", label = "mu_L",
min = 0.0105, max = 0.0105, value = 0.0105, step = 0, width=100)
),
column(2, numericInput("mu_P", label = "mu_P",
min = 0.01041, max = 0.01041, value = 0.01041, step = 0, width=100)
),
column(2, numericInput("mu_A", label = "mu_A",
min = 0.091, max = 0.091, value = 0.091, step = 0, width=100)
),
column(2, numericInput("mu_w", label = "mu_w",
min = 0.0, max = 1, value = 0.1, step = 0.1, width=100)
),
column(2, numericInput("alpha", label = "alpha",
min = 0.0, max = 1000, value = 10, step = 10, width=100)
)
)
),
mainPanel(h3("Simulation results"),
plotOutput("AedesIbag_model")
)
)
gives this output:给出这个 output:
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.