1

I have created A Shiny App And i want to insert the same content of my shinyapp app in my C# Application. If there's any way to do that ?

Mümin
  • 309
  • 1
  • 20

1 Answers1

3

One way of doing it, this is how I set it up for my team, so we can have the best of both worlds is to use an iframe. If you're using MVC then something like this should do:

Controller.cs

using System.Web.Mvc;

namespace Dashboard.Controllers
{
    public class ShinyController : Controller
    {
        public ActionResult Index()
        {
            ViewBag.IFrameSrc = "Address to your shiny app";
            return View();
        }

    }
}

Index.cshtml

<iframe style="border: 0; position:relative; width:100%; height:100%" src="@ViewBag.IFrameSrc"></iframe>
Pork Chop
  • 28,528
  • 5
  • 63
  • 77
  • Thanks Pork For this Answer But there's no way to use the code only without making shiny app on the server and then use the link of this app in server ? I mean can i use shinyapp code in R studio in C# code in Visual Studio directly ? – Mümin Dec 13 '17 at 12:28
  • 1
    You can maybe try this https://stackoverflow.com/questions/45605523/can-i-run-a-shiny-app-from-within-r-tools-for-visual-studio – Pork Chop Dec 13 '17 at 12:30
  • But This one for using RTools not to use R Code in C# – Mümin Dec 13 '17 at 12:33
  • You could use something like R.NET: https://github.com/rdotnet/rdotnet – StatsStudent Sep 20 '22 at 09:09