我想繪製3次測量,使用戶得到分散的感覺添加的情節。[R光澤,如何在一列
ui.R
shinyUI(fluidPage(
fluidRow(
h2("Enter 3 values"),
column(width=2,offset=0, numericInput("triceps.sf1", label = "1.", value = 0)),
column(width=2,offset=0, numericInput("triceps.sf2", label = "2.", value = 0)),
column(width=2,offset=0, numericInput("triceps.sf3", label = "3.", value = 0)),
column(width=8,offset=0, plotOutput("sfTricepsPlot"))
)
)#fluidpage
)#shinyUI
和服務器代碼,其中每個測量被繪製爲橫: 我使用以下代碼創建A R光澤應用
server.R
library(graphics)
shinyServer(function(input, output) {
###################################
## Plot the values of sf measured
sfPlot <- function(m1, m2, m3){
par(mai = c(0.8, 0.8, 0.3, 0.8))
plot(1, axes=F, xaxt = "n", xlab = "Mesures", ylab = "sf (mm)", xlim = c(0.8, 3.2), ylim=c(0.8*m1, 1.2*m1))
axis(1, at=1:3)
axis(2, at=seq(from=0.8*m1, to=1.2*m1, by=10))
points(x=1, y=m1, pch=4, lwd=2, cex=1.5)
points(x=2, y=m2, pch=4, lwd=2, cex=1.5)
points(x=3, y=m3, pch=4, lwd=2, cex=1.5)
}
######################################
## Plot the triceps sf
output$sfTricepsPlot <- renderPlot({
sfPlot(input$triceps.sf1, input$triceps.sf2, input$triceps.sf3)
})
})
您將看到的情節出現在需要的輸入值線以下。 我怎麼能讓情節躺在右側? 我的目標確實是在最後的代碼中的許多輸入線,其右側的情節會使頁面更加緊湊。
改變偏移移動陰謀右側,但仍位於第一行下面,我想三個輸入標籤和情節是同一行 –
可以作爲一個魅力(儘可能) ,謝謝GyD –