내가 C 드라이브의 데이터를 먼저 확인하기 위해 반짝이는 서버 스크립트를 작성하고 있습니다. 그곳에 있으면 다른 데이터 처리를 수행하는 것이 좋습니다. 다음 반복을 위해 저장하십시오. 그리고 데이터의 이름은Shiny : reactive() check on read.csv
그래서 다음 번에 내 큰 문제가 단지 실행 예
library(shiny)
library(datasets)
library(ggplot2)
mt=mtcars
shinyServer(function(input, output) {
data1 =reactive({
if(file.exists("input$var.csv")
{data=read.csv(input$var.csv)})
else{
data=mt[mt$cyl==input$var,]
write.csv(data,file="c:\\input$var.csv")
}
})
output$Plot1 <- renderPlot({
data2=data1()
ggplot(data2$d,aes(x=gear,y=wt))+geom_boxplot() })
})
필자는 file.exists 함수를 결정하기 위해 붙여 넣기를 사용해야한다고 생각합니다. 입력 $ var.csv라는 파일을 찾습니다. 'file.exists (paste0 (input $ var, ".csv"))'와 같이하면,'read.csv (paste0 (input $ var, ".csv"))'와 동일하거나 다른 것에 관한 질문입니까? – timfaber
고마워요. @timfaber .. 정말 도움이됩니다. –