Skip to main content

Posts

Showing posts from April, 2021

Building my first R Shiny app -> Covid19 status for: France, UK, Italy, Germany, Poland, Spain.

 The report I will show here consists of two charts: line chart and scatterplot. On the left top corner you can choose country (one of six) and accordingly the report will present this two graphs for the selected country. On the right sight of the report you will see small table and check box for Scatterplot chart. You can choose scatterplot with or without regression line. The report looks like this   https://karolinamgoma.shinyapps.io/covid19/ I will explain you step by step how to build such shiny app by yourself. It will be useful to read my previous post so you can already be able to create your app.R script. If your app.R already exist we can add some libraries which I am going to use. Install them if you don't have it yet. Libraries library(shiny) # for building web app library(readr) #data import tool, part of the Tidyverse. library(dplyr) #perfect package for data manipulation, queries and much more, part of the Tidyverse. library(ggplot2) #package for data visua...

Interactive charts with R shiny app

Let's start with so motivational material. I recommend you to visit website: https://shiny.rstudio.com/gallery/   Impressive, isn't ? I was watching with open mouth all this visualizations, changing parameters and observing how it would change. Creating such reports are possible with R shiny app. Shiny is an open source R package for building web application. First install it on your computer. install.packages("shiny") R Shiny Framework Choose in your open RStudio: File-> New Project->New Directory->Shiny web Application. RStudio will create script app.R Delate the content and write shinyapp and press Shift+Tab, you should see the following: library(shiny) ui <- fluidPage( ) server <- function(input, output, session) {  } shinyApp(ui, server) This is the main structure when you are building your shiny app. You need user interface (ui), server and shinyApp() function. There are three pieces of an interactive component: 1. User interface will collect user...