我希望我的徽标(一个png文件)显示在闪亮的仪表板左上角。所以我把png文件保存在这里:
$$:/srv/shiny-server/www$ ll
total 24
drwxr-xr-x 2 root root 4096 Jul 7 00:49 ./
drwxrwxrwx 3 root root 4096 Jul 7 00:48 ../
-rw-rw-r-- 1 root root 14390 Jul 6 23:38 logo.png因为我的/etc/shiny-server/shiny-server.conf文件包含:
# Host the directory of Shiny Apps stored in this directory
site_dir /srv/shiny-server;在我的MyApp/ui.R代码中,我有:
shinyUI(
dashboardPage(
dashboardHeader(
title = tags$a(href='http://www.tech.com', tags$img(src="logo.png")),
...
)这个应用的名字是MyApp,它有server.R和ui.R。
当我运行这个程序时,我得到一个问号图标,我认为这意味着它找不到该文件。我不能得到的是闪亮的服务器到底在哪里寻找这个文件?我应该把它放在哪里,这样它才能读取文件?
我已经设置了logo.png文件的读取权限,并尝试将其放在各种位置(在/src/shiny-server和MyApp中,在www文件夹内或不在www文件夹内,但都无济于事)。很明显,我错过了约定设置的实际正确位置。问题是,RStudio没有在控制台给出任何错误消息,这些错误消息可能会读到类似“无法找到文件...当查看位置时...”之类的内容。
我尝试了文档,但没有一个明确的例子,确切地把这个png文件放在哪里使它工作。
我使用的是shiny-server版本1.4.2
> system('shiny-server --version', intern = TRUE)
[1] "Shiny Server v1.4.2.786" "Node.js v0.10.40"
> packageVersion("shiny")
[1] ‘0.13.2’我将非常感谢在这件事上的任何帮助。非常提前谢谢你。
https://stackoverflow.com/questions/38232479
复制相似问题