我似乎无法在闪亮的服务器上使用write.csv。我收到这个错误:
cannot open file 'data/Available.csv': Permission denied
我已经阅读了这篇文章(https://groups.google.com/forum/#!topic/shiny-discuss/srWETT6uL-I),结果尝试了这个:
sudo chown shiny:shiny /path_to_app/data
但仍然没有运气。我使用Dean Attali的帖子(http://deanattali.com/blog/shiny-persistent-data-storage/)中的以下函数:
outputDir <- "data"
saveData <- function(data) {
# Write the file to the local system
write.csv(
x = data,
file = file.path(outputDir, "Available.csv")
)
}
结合:
observeEvent(input$swafer, {
saveData(values1$available)
})
...写我的.csv文件。也许我需要在服务器上以管理员身份登录才能分配权限(当前以用户身份登录)?或者我的outputDir
可能必须是完整的扩展吗?
修改
似乎我将outputDir
更改为data
以外的任何其他内容。我猜data
是闪亮的特殊子目录。