Sep 14, 2013

My first R Shiny Web Application using breast cancer data

I love the idea of making non-R users playing with my datasets. Thanks to R Shiny package this is is now possible and I am going to post here my code for a simple web application.

But first a few lines about Shiny package and my dataset. Okay…if you are in a hurry and want to go straight to check my app, here is the link http://spark.rstudio.com/marqui/breastcancer/



Shiny package


Shiny is a new package created by RStudio (http://www.rstudio.com/shiny/) that makes it very easy to build interactive web applications with R. Yes, that means that anyone can use it, interact with your data and gain insights from your analysis results.



The dataset & my app


The web application I’ve built allows you to explore and visualize data about new cases of breast cancer across countries. The app is quite simple: you first select the continent you are interest in, and you get:
  1. a table of countries sorted from the highest breast cancer rate to the lowest
  2. a world map with data plotted over it

My dataset includes breast cancer data for 174 countries and it was originally collected by ARC (International Agency for Research on Cancer) in 2002. Actually my dataset includes also several other socio-economic variables (which I am not going to explore in this occasion) and went through a previous “cleaning stage” where I added further variables. Check my previous post for more info on that how to plot data over a map with R.   


My code


To build a Shiny app you need to create two separate components (scripts): a user interface definition and a server script. The first is named ui.R and the latter server.R ; bot must be located in the same folder (your shiny app directory). Finally, to run it, you need to first make sure you are pointing to your app directory and execute these commands:

> library (shiny) # to load the shiny library

> runApp() # or runApp(“location of your app folder”) if that is not set as your working directory

Here below are my scripts for the user interface and server components. Oh yes, if you have not clicked yet on the link above, again this is the link where you can access my app http://spark.rstudio.com/marqui/breastcancer/

81 comments:

  1. Is it okay to post part of this on my website basically post a hyperlink to this webpage? epithelioid tissue

    ReplyDelete
  2. Thanks a lot for one’s intriguing write-up. It’s actually exceptional. Searching ahead for this sort of revisions.
    https://asbestoscancer.org/epithelioid-mesothelioma/

    ReplyDelete
  3. I really enjoy simply reading all of your weblogs. Simply wanted to inform you that you have people like me who appreciate your work. Definitely a great post. Hats off to you! The information that you have provided is very helpful. ซิลิโคนหลังผ่าตัดเต้าน

    ReplyDelete
  4. Most man-made brainpower frameworks out there can just deal with this undertaking as it applies to constrained subjects.
    ai courses

    ReplyDelete
  5. Profit primarily prime quality items -- you can understand them all within: Tumors

    ReplyDelete
  6. A IEEE project is an interrelated arrangement of exercises, having a positive beginning and end point and bringing about an interesting result in Engineering Colleges for a particular asset assignment working under a triple limitation - time, cost and execution. Final Year Project Domains for CSE In Engineering Colleges, final year IEEE Project Management requires the utilization of abilities and information to arrange, plan, plan, direct, control, screen, and assess a final year project for cse. The utilization of Project Management to accomplish authoritative objectives has expanded quickly and many engineering colleges have reacted with final year IEEE projects Project Centers in Chennai for CSE to help students in learning these remarkable abilities.



    Spring Framework has already made serious inroads as an integrated technology stack for building user-facing applications. Spring Framework Corporate TRaining the authors explore the idea of using Java in Big Data platforms.
    Specifically, Spring Framework provides various tasks are geared around preparing data for further analysis and visualization. Spring Training in Chennai


    ReplyDelete
  7. They run pink gatherings and offer pink items so as to fund-raise. Numerous organizations partake and do exceptional advancements during October for their favored philanthropy. "Pink" is huge business.
    Breast Cancer

    ReplyDelete
  8. Very informative post ! There is a lot of information here that can help any business get started with a successful social networking campaign ! Latest & Bugs Free Version

    ReplyDelete
  9. Hi to everybody, here everyone is sharing such knowledge, so it’s fastidious to see this site, and I used to visit this blog daily Latest & Updated Version

    ReplyDelete
  10. Great tips and very easy to understand. This will definitely be very useful for me when I get a chance to start my blog. Tubemate APK Here Download Latest & Updated File

    ReplyDelete
  11. Very nice blog and articles. I am realy very happy to visit your blog. Now I am found which I actually want. I check your blog everyday and try to learn something from your blog. Thank you and waiting for your new post. Tubidy APK 2020 Download Free Latest and Update

    ReplyDelete
  12. I really like your writing style, great information, thankyou for posting. logo inspiration

    ReplyDelete
  13. it was a wonderful chance to visit this kind of site and I am happy to know. thank you so much for giving us a chance to have this opportunity.. design

    ReplyDelete
  14. New web site is looking good. Thanks for the great effort. design

    ReplyDelete
  15. Replenish 360 offers one of the most affordable wellness and preventative services that are personalized and one of the most activating one-of-a-kind IV drip and infusions, vitamin and antioxidant supplementation, micronutrient therapy, and other additional supplementary wellness services to “renew your body, refresh your mind, and restore performance.” IV Therapy Palm Springs

    ReplyDelete
  16. Thanks for taking the time to discuss this, I feel strongly about it and love learning more on this topic. If possible, as you gain expertise, would you mind updating your blog with extra information? It is extremely helpful for me. brand identity design company

    ReplyDelete
  17. These are some great tools that i definitely use for SEO work. This is a great list to use in the future.. buy likes cheap

    ReplyDelete
  18. This article is to help you find some of the best weight loss supplements available. how to weight loss fast

    ReplyDelete
  19. Yes, I am entirely agreed with this article, and I just want say that this article is very helpful and enlightening. I also have some precious piece of concerned info !!!!!!Thanks. veja aqui como baixar Lulubox atualizado

    ReplyDelete
  20. This is because each student is different and has a different understanding of things. artificial intelligence certification

    ReplyDelete
  21. As a data science professional, you have a large field to work in artificial intelligence certification

    ReplyDelete
  22. Then group them in LLCs accordingly. As an example, it's not a good idea to include a single family beach front rental in Maui in the same LLC as a duplex on the wrong side of town.

    watch series free

    ReplyDelete
  23. Excellent .. Amazing .. I’ll bookmark your blog and take the feeds also…I’m happy to find so many useful info here in the post, we need work out more techniques in this regard, thanks for sharing. Breast cancer

    ReplyDelete
  24. Wow! Such an amazing and helpful post this is. I really really love it. It's so good and so awesome. I am just amazed. I hope that you continue to do your work like this in the future also click here

    ReplyDelete
  25. This is an excellent post I seen thanks to share it. It is really what I wanted to see hope in future you will continue for sharing such a excellent post. website design columbia sc

    ReplyDelete
  26. Extraordinary blog. I took pleasure in scrutinizing your articles. This is extremely a marvelous scrutinized for me. I have bookmarked it and I am suspecting examining new articles. Continue doing magnificent!here

    ReplyDelete
  27. You have a excellent blog here! do you want to develop invite posts in this little weblog?apps pour pc

    ReplyDelete
  28. That is really nice to hear. thank you for the update and good luck. Protocol

    ReplyDelete
  29. Thanks, foг ones marvelous posting! I genuinely enjoyed reading it, you miggһt Ƅe a great author. I wiⅼl made certain to booҝmark your blog and ѡill often come back sometime soon. I want to encoᥙrage yourself to continue your great job, have a nice evening!
    Web Development Course
    best web development courses
    web development classes
    web development course near me
    Web Development Training
    training on web development
    web development training program
    web development training course
    web development summer training

    ReplyDelete
  30. Great post i must say and thanks for the information. Education is definitely a sticky subject. However, is still among the leading topics of our time. I appreciate your post and look forward to more. cronache pescara

    ReplyDelete
  31. This was a really great contest and hopefully I can attend the next one. It was alot of fun and I really enjoyed myself.. docker hosting

    ReplyDelete
  32. Shape alludes to the real state of the implant, round or anatomical. Profile alludes to the separation the implant ventures off the chest divider. The third Choice is the outside of the implant
    Motiva Implants

    ReplyDelete
  33. Great Post. Thanks for this information.

    ReplyDelete
  34. The Basics Setting up a web hosting account for the first time can be confusing and frustrating for the novice. This article will guide you through the steps of setting up a new web hosting account f... the best web hosting companies

    ReplyDelete
  35. This is a good subject to talk about. Sometimes I fav stuff like this on Redit. This article probably wont do well with that crowd. I will be sure to submit something else though. Website Development Company

    ReplyDelete
  36. This blog website is pretty cool! How was it made ! website ranking

    ReplyDelete
  37. Text that is too little to even think about reading .Webdesign

    ReplyDelete
  38. Thanks for sharing this, I actually appreciate you taking the time to share with everybody.
    Best Institute For Data Science In Hyderabad

    ReplyDelete
  39. Nice Information! VanyaHealth provides online platform for Cancer TeleConsultation in India. Give a second chance to your love once who are fighting against Cancer. Consult Top Oncologist in India at affordable rates.

    ReplyDelete
  40. thanks for sharing this At SynergisticIT we offer the best aws training san francisco

    ReplyDelete
  41. As usual, there are pros and cons to everything on the web and that includes cloud hosting for business. We will go through some pros and cons, advantages and disadvantages that may help you decide whether cloud web hosting is right for your firm. iPage hosting black Friday

    ReplyDelete
  42. Many technology vendors and service providers consistently make common mistakes that can expose them to unnecessary liability, and cost them revenue. This article can help your technology company address and resolve these mistakes and increase your success. Best Bluehost codes

    ReplyDelete
  43. Great article Lot's of information to Read...Great Man Keep Posting and update to People..Thanks useless website generator

    ReplyDelete
  44. Many technology vendors and service providers consistently make common mistakes that can expose them to unnecessary liability, and cost them revenue. This article can help your technology company address and resolve these mistakes and increase your success. iPhoneIMEI.net

    ReplyDelete
  45. It's these things, however one other thing that is without a doubt, there is a great deal of disarray and falsehood around all parts of cancer and explicitly cancer therapies and endurance rates. what is a cbd

    ReplyDelete
  46. Any organizations which are planning to build their online presence are employing a SEO organization or utilizing SEO benefits well to increase each and every advantage while accomplishing their objectives.SEO Services

    ReplyDelete
  47. Wow, What a Excellent post. I really found this to much informatics. It is what i was searching for.I would like to suggest you that please keep sharing such type of info.Thanks LinkedIn contact emails

    ReplyDelete
  48. This is a wonderful article, Given so much info in it, Thanks for sharing. CodeGnan offers courses in new technologies and makes sure students understand the flow of work from each and every perspective in a Real-Time environment Augmented reality course in vijayawada. ,

    ReplyDelete
  49. I am 63 years of age and in the course of my life I have seen the media declare a few diverse cancer fixes that were totally hushed. states where cbd is illegal

    ReplyDelete
  50. Information technology training is typically thought of as only being necessary for IT personnel in the trenches. This article discusses the importance of IT management training for adapting to new business technologies and identifying new technologies to add to your business strategies. cheap windows vps

    ReplyDelete
  51. Thanks for the blog loaded with so many information. Stopping by your blog helped me to get what I was looking for. Harrisburg Marketing

    ReplyDelete
  52. What a fantabulous post this has been. Never seen this kind of useful post. I am grateful to you and expect more number of posts like these. Thank you very much. wileyplus answers

    ReplyDelete
  53. Wow, What a Excellent post. I really found this to much informatics. It is what i was searching for.I would like to suggest you that please keep sharing such type of info.Thanks agence de pub Strasbourg

    ReplyDelete
  54. A list of common mistakes made by law students when applying for solicitor training contracts. Find out how to improve your Fókuszpályázat and your chances of success.

    ReplyDelete
  55. I think this is an informative post and it is very useful and knowledgeable. therefore, I would like to thank you for the efforts you have made in writing this article.
    business analytics course


    ReplyDelete
  56. Today, I was just browsing along and came upon your blog. Just wanted to say good blog and this article helped me a lot, due to which I have found exactly I was looking. dotcomsecrets

    ReplyDelete
  57. DCIS is early breast cancer that is confined to the inside of the ductal system. The distinction between comedic and non-comedy types is important, as comedocarcinoma in-situ generally behaves more aggressively and may show areas of micro-invasion through the ductal wall into surrounding tissue. Breast Cancer

    ReplyDelete
  58. Excellent effort to make this blog more wonderful and attractive. ExcelR Data Analyst Course

    ReplyDelete
  59. I haven’t any word to appreciate this post.....Really i am impressed from this post....the person who create this post it was a great human..thanks for shared this with us. sviluppo siti web Corsico

    ReplyDelete
  60. I got too much interesting stuff on your blog. I guess I am not the only one having all the enjoyment here! Keep up the good work. best places to hire freelancers

    ReplyDelete
  61. Here you will learn what is important, it gives you a link to an interesting web page: Get web series

    ReplyDelete
  62. If the natural supplements do not get into our body's cells, they can't do the work they are intended to do, including to strengthen the immune system and help build our good health. Instagram seamoss_valley

    ReplyDelete
  63. When your website or blog goes live for the first time, it is exciting. That is until you realize no one but you and your. sayapro checker

    ReplyDelete
  64. Can I just say what a aid to search out somebody who truly is aware of what theyre talking about on the internet. You definitely know how to carry a problem to gentle and make it important. Extra people have to learn this and understand this aspect of the story. I cant consider youre not more fashionable because you positively have the gift.Budget Accounting Services Singapore

    ReplyDelete
  65. From the above insights, it is obvious that the size of an association assumed a part in the assurance of the measure of profits got. It beats rationale for one to anticipate that an enormous association should get low measures of profits and the other way around. Website laten maken

    ReplyDelete
  66. The Web website presents the substance and intuitive highlights or interfaces to the end client as Web pages. How the data mentioned is shown to the client is standard of the Web design measure. Webdesign Genk

    ReplyDelete
  67. Can nicely write on similar topics! Welcome to here you'll find out how it should look. home page

    ReplyDelete