R Shiny Apps Tutorial | Deploy & Share Shiny Apps online | install required packages and publish app

แชร์
ฝัง
  • เผยแพร่เมื่อ 14 ต.ค. 2024
  • Hello, welcome to this video.
    In this video we will install the required packages (primarily the rsconnect package), add shinyapps.io account and try to deploy the app. rsconnect package helps to establish connection between R Studio and shinyapp.io user account. I am in R Studio. We have shiny apps example files here which we would like to deploy. We will use the publish application menu option. Publish Application menu can be located beside the Run App button in R Studio.
    Click the publish application button and it will prompt us to install required packages. Click YES to begin the installation.
    Since I already have the account set up it shows me the existing account here which I can use to deploy the app. However, for the sake of this tutorial let us add the account which we created with shinyapp.io in the previous video. Add title to the app, click on add new account and then select Shinyapps.io. This will prompt us to enter the secret key.
    Login to the shinyapps.io account. Click on the top right image icon and select token.
    Click on show and then show secret. Copy this entire rsconnect function and paste in R Studio, click on connect account. This will set up and add a new account to R Studio which we can use to deploy.
    Select on the account where we would like to deploy. We already have the app title filled. Now click on the publish button.
    We can see the logs showing the status in the console.
    And we see that shiny app is finally deployed and opens in the browser. We can use this URL and share our shiny app with others.
    For any questions or consultation, contact me on GMAIL at aagarw30.
    Linkedin:
    / abhinav-agrawal-pmp%c2...
    Github:
    github.com/aag...

ความคิดเห็น • 26

  • @primeshchanaka3134
    @primeshchanaka3134 3 ปีที่แล้ว

    in the free version, can we deploy 5 apps in every month OR only 5 apps forever?

  • @siddarthsheshagiri9713
    @siddarthsheshagiri9713 4 ปีที่แล้ว

    I am trying to deploy a shiny app that retrieves info from the sql server satabse from my computer

  • @apoorvamkulkarni5737
    @apoorvamkulkarni5737 5 ปีที่แล้ว

    Hi Abhinav, thanks for the wonderful tutorial! I have created a R shiny app that gather information from MySQL . My app runs fine locally but when I try to publish it, i get an "Failed to connect to database: Error: Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)". Do you have any idea how to tackle this?Web answers directed towards changing Socket information on my.ini file. Did that but did not get through the problem! Would really appreciate your help!Thanks!

    • @abhinavagrawal6317
      @abhinavagrawal6317  5 ปีที่แล้ว

      Hello Apoorva,
      The error points that post deployment, the app is trying to connect to local host/local machine (app from internet trying connect local). I believe there should be a web service or remotely set up DB that this app can connect to and use.
      Recommend please check how app is connecting to MySQL, what parameters are defined for connection. Is there something which is blocking the connection when app is deployed to shinyio. Are you able to connect remotely to that DB yourself?
      This seems to be more of a remote connection to MySQL issue.
      ty
      Abi

  • @perotsystemsambattur
    @perotsystemsambattur 5 ปีที่แล้ว

    I want to deploy a prediction model which is developed using R studio. Now I want to develop a web application at my local host. The web application should take four drop down list and display the predict the result as text on the page. How should i proceed. Right now I am not using any database. Plz guide me. I am stuck

    • @abhinavagrawal6317
      @abhinavagrawal6317  5 ปีที่แล้ว

      Hello "hi",
      There are several parts of the question.
      You need to answer yourself few questions before can proceed :
      Firstly, what is the source of your data?
      Second, do you have a prediction model built in R already?
      Third, Is the model giving the results as per your need in the R console?
      If all the above answer holds good, you just need to integrate your model into R Shiny and create the app.
      you can connect to me on my gmail if help needed with integration of prediction model with Shiny. I will try providing guidance around integration.
      Hope this helps.
      ty Abi

    • @perotsystemsambattur
      @perotsystemsambattur 5 ปีที่แล้ว

      @@abhinavagrawal6317 thanks for ur reply.
      I have the dataset in csv file. And follow machine learning approach to create models using random forest, knn, naive bayes, decision tree with c5 etc in R studio. I find random forest to give best prediction and want to use it for deployment in a web page. I need four inputs ( textbox) from a user to get the result predicted. The prediction can be presented in text to keep it simple. Thanks once again

  • @inthedataway
    @inthedataway 3 ปีที่แล้ว

    Hi Abhinav, I m trying to deploy an excel file processor Shiny app, where I upload an xlsx file, and I add 2 download buttons to downloaod the processed raw report in .xlsx file. I've written the processing dplyr code inside the content part of downloadhandler, and I don't see the Publish button at all. When I try to do it from the File menu, this is the error I get :
    Can't Publish Content
    The content type 'Content' is not currently supported for publishing.
    I can't find any solution to this.
    Great videos BTW

    • @abhinavagrawal6317
      @abhinavagrawal6317  3 ปีที่แล้ว

      Hello Vinit, is the app working fine in local? Also, is there a way you can share a reproducible code snippet that I can review and debug in my system? You can connect me on Gmail at aagarw30.

    • @inthedataway
      @inthedataway 3 ปีที่แล้ว

      @@abhinavagrawal6317 Yes the app works well locally, but when I go to publish, I get that error. Based on the mention of 'content', I thought it was to do with the filedownloader content, but I'm not sure where the roadblock is. I see the publish button otherwise, for other scrits. I'll see if I can send it over to you. Thank you

    • @inthedataway
      @inthedataway 3 ปีที่แล้ว

      Hi Abhinav, I've emailed you my problem synopsis and the StackOverflow post. Let me know what you think.

  • @LeonelaLorenaYamucaSalvatierra
    @LeonelaLorenaYamucaSalvatierra 5 ปีที่แล้ว +1

    The following message appears in Internet Explorer: The website cannot display the page. And in google chrome I get the following message:ERROR: An error has occurred. Check your logs or contact the app author for clarification.. Do you have any solution? Please help :(

  • @dynamicsofJellal
    @dynamicsofJellal 4 ปีที่แล้ว

    Can't view my images when I published it. How?

    • @abhinavagrawal6317
      @abhinavagrawal6317  4 ปีที่แล้ว

      Can you tell where did you place the media files with respect to the r code files? I mean the folder structure of your app. Also, what exactly you get after the app upload? You can connect on Gmail @ aagarw30

    • @dynamicsofJellal
      @dynamicsofJellal 4 ปีที่แล้ว

      @@abhinavagrawal6317 I already fix the error man. Appreciated! I'll just contact you if I have any concern in the future.

    • @abhinavagrawal6317
      @abhinavagrawal6317  4 ปีที่แล้ว

      @@dynamicsofJellal glad to know you were able to fix. Happy learning. Ty Abi

    • @dynamicsofJellal
      @dynamicsofJellal 4 ปีที่แล้ว

      @@abhinavagrawal6317 i emailed