如何部署使用本地数据的闪亮应用 [英] how to deploy shiny app that uses local data

查看:29
本文介绍了如何部署使用本地数据的闪亮应用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

I'm deploying my shiny app and I don't know how to input my a local dataset. I keep getting Error: object "data" not found. Here is my path to shiny folder.

library(shinyapps)
shinyapps::deployApp('C:\Users\Jeremy\Desktop\jerm2')

In this directory (jerm2), I have 3 things: ui.R, server.R, and my local dataset, a .csv called proj.csv.

In the server.R file, I set data<-read.csv("proj.csv")

I just don't know how to get Shiny to pick up my datasets.

解决方案

You may want to add a subdirectory in your shiny folder called "Data" and put proj.csv there.

Then, in your server.r put:

data<-read.csv("./Data/proj.csv")

That will make it clear where the data is when the app is deployed to the ShinyApps service.

这篇关于如何部署使用本地数据的闪亮应用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆