我有一个显示一些数据的非常简单的应用程序。 如何使用 iframe 将其嵌入到 SharePoint 网站中? 或者有更简单的方法吗?
library(ggplot2)
library(shiny)
library(DT)
library(readr)
PRTypeCount <- read_csv("H:/SP/PRTypeCount.txt")
ui <- navbarPage(
title = 'PRTypeCount',
tabPanel('PRTypeCount', DT::dataTableOutput('PRTypeCount')))
server<-function(input, output) {
output$PRTypeCount <- DT::renderDataTable(
DT::datatable(PRTypeCount, options = list(pageLength = 25))
)
}
shinyApp(ui = ui, server = server)
最佳答案
如果您没有 Shiny 的服务器,您最好的选择可能是 flexdashboard 包或制作单独的组件并在 SharePoint 设计器中安排它们。这是一个简单的示例,与 shiny 相比,您的交互性会有所限制——您可以使用 plotly、ggiraph 和其他一些包来做一些事情。对于许多用例,这已经足够了:
---
title: "Untitled"
output:
flexdashboard::flex_dashboard:
orientation: columns
vertical_layout: fill
---
```{r setup, include=FALSE}
library(flexdashboard)
```
Column {data-width=650}
-----------------------------------------------------------------------
### Chart A
```{r}
DT::datatable(iris)
```
Column {data-width=350}
-----------------------------------------------------------------------
### Chart B
```{r}
hist(iris$Sepal.Length)
```
### Chart C
```{r}
plot(iris$Sepal.Length, iris$Sepal.Width)
```
将此 rmd 文件编入 html 后。您可以制作 HTML 文件的副本并将扩展名更改为 .aspx。
然后你可以把这个.aspx文件放在一个文档库中。
然后在要显示内容的位置添加页面查看器 Web 部件,将其链接到文档库中的 .aspx 文件。
关于r - 如何使用 Iframe 标记在 SharePoint 上嵌入 Shiny 的应用程序,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44334272/