c# - r闪亮的ggplot在使用R.net的WPF C#中不起作用
问题描述
我尝试在 C# WPF 中使用 Shiny(R) ,有按钮可以激活闪亮的应用程序
使用 C# R.net 我构建了闪亮的应用程序,我认为一切正常,但是当我绘制 ggplot 时出现 C# 错误(System.StackOverflowException,HResult=0x800703E9)
此外,没有 ggplot ,它运行良好....但我想使用 ggplot
我一直在寻找几天来找到解决方案
请帮忙,提前谢谢
C# 代码
using RDotNet;
REngine.SetEnvironmentVariables();
REngine rEngine = REngine.GetInstance();
rEngine.Initialize()
rEngine.Evaluate("source('../../R/R_CODE/shiny/shiny_run.R')");
源代码中的 R 闪亮代码('../../R/R_CODE/shiny/shiny_run.R')
library(ggplot2)
library(dplyr)
library(shiny)
library(shinydashboard)
##############
ui <- dashboardPage(
dashboardHeader(),
sidebar<-dashboardSidebar( )
,
body<-dashboardBody( plotOutput("sample1") )
)
server <- function(input, output,session) {
session$onSessionEnded(function() {
stopApp()
})
toy = data.frame(x=c(1,2,3,4),y=c(1,2,3,4))
output$sample1 = renderPlot({
ggplot(data=toy,aes(x,y))+geom_point()
})
}
app=shinyApp(
ui,server
)
runApp(app)
解决方案
推荐阅读
- javascript - 为 React 函数保留状态文本,没有 Redux
- c# - WPF - 更改 App.xaml 中定义的 FontSize
- vba - 是否可以使用 VBA 在 PowerPoint 中将幻灯片上的所有内容沿一个方向移动一定距离(英寸)?
- spring-boot - 如何在 Thymeleaf 中使用多个 If else 语句来更改表格行颜色
- r - 闪亮的倒数计时器然后触发
- angular - 我有一个错误陈我正在尝试下载离子
- r - 来自 ggpol 的 facet_share 创建了太大的边距
- c++ - 继承和函数重载
- python - 如何在熊猫数据框中的日期时间检查前几行中的行值?
- vim - Vim 右括号(不使用插件)在我按 enter 或在第一个括号后不立即按 enter 时表现不同