"원자 벡터에 대해 $ 연산자가 잘못되었습니다."오류가 발생했습니다. gvisLineChart를 추가하면 발생합니다. 어떤 제안?
library(shiny)
library(googleVis)
#this is a dput of a sql query to make the example reproducible.
#In reality this will be an RODBC sqlQuery result
dataset <- structure(list(id = c(1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L),
value = c(1.68294196961579, 82.4641565111739, 83.3056274959818,
6.73176787846317, 5.89029689365528, 2.52441295442369, 4.20735492403948,
0.841470984807897, 5.04882590884738, 15.1464777265421)),
.Names = c("id", "value"), row.names = c(NA, 10L), class = "data.frame")
ui <- shinyUI(
plotOutput("motionPlot")
)
server <- shinyServer(function(input, output) {
output[["motionPlot"]] <- renderGvis({
Line <- gvisLineChart(dataset, xvar=c("id"), yvar=c("value"))
plot(Line)
})
})
shinyApp(ui = ui, server = server)
그것은 [재현 예]없이 도움이 매우 어려운 (http://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example) . 'dataset'과 같은 소리는 data.frame이 아니지만 테스트를 위해 코드를 실행할 수는 없습니다. – MrFlick
이 예제에서 msdb 데이터베이스를 사용하여 mssql db를 가진 모든 사용자가 실행할 수 있도록했습니다. 모든 데이터베이스에 대한 쿼리는 결과를 재현합니다. 불행히도 DB 관련 질문이므로 'reproducible'은 데이터베이스에 대한 참조를 포함합니다. 관심을 가져 주셔서 감사합니다. 도움을 주시면 감사하겠습니다. – dataphile
sqlQuery 결과를 재현 가능하도록 만들었습니다. – dataphile