Article thumbnail

Analytics in R Shiny app with WebDataRocks

In this article

Learn how R Shiny and WebDataRocks enhance interactive web apps for data analysis. Integrate our pivot table component into R Shiny projects effortlessly, enabling dynamic data manipulation and visualization.

What is R Shiny?

R Shiny is a package for building interactive web apps with R. 

The distinguishing feature of R Shiny is that you can build analytical apps with minimum lines of code and simple syntax, and put them on the web in a short time.

Pivot for R Shiny

Great news for the data science and analytics community!

Now you can use our pivot table component in R Shiny projects.

We are extremely grateful to our active community for contributions. Thankfully to Mohamed El Fodil Ihaddaden, now our users can perform data analysis with WebDataRocks in R Shiny apps. 

R Shiny comes with a great collection of interactive widgets. We believe WebDataRocks perfectly complements it. With the pivot table and simple syntax of R, you can build a dashboard that assists in connecting data scientists with decision-makers.

Features & benefits of Pivot for R

The role of WebDataRocks lies in aggregating and presenting your data in a neat tabular report. By handling all the data-related calculations, it acts as an engine for your dashboard. So, once it’s added to the dashboard, end-users can:

  • Drag and drop fields on the grid
  • Slice and dice data to compose a unique report
  • Sort and filter data records
  • Highlight values with conditional formatting
  • Format numbers on the grid
  • Export reports into a suitable format

And more! To dive into the world of WebDataRocks features, peek into our UI guide.

Creating a simple analytical app with R Shiny

Let’s apply our knowledge in practice and create a single-file R Shiny app with basic reporting functionality.

Create a new directory (e.g., reporting_app) and the app.R file that contains a user-interface definition and a server script. Run the R Studio and make this folder your working directory.

Next, install the pivtalibrary – a wrapper for R:

remotes::install_github("feddelegrand7/pivta")

Then, load the package to the app:

library(pivta)

Next, render the pivot table using pivta() function and passing the path to a data source and the report configuration as inputs.

pivta(dsource = "https://cdn.webdatarocks.com/data/data.csv", report = "https://cdn.webdatarocks.com/reports/report.json")

Here is how the full code of the app looks like:

library(shiny)
library(pivta)

ui <- fluidPage(
  
  # App title ----
  titlePanel("Reporting app"),
  pivtaOutput(outputId = "pivot_table")
)

server <- function(input, output) {
  
  output$pivot_table <- renderPivta({
    pivta(dsource = "https://cdn.webdatarocks.com/data/data.csv", report = "https://cdn.webdatarocks.com/reports/report.json")
  })
}

shinyApp(ui = ui, server = server)

Despite being simple, it creates an app with powerful pivoting features. 

Results

Now you have an interactive dashboard in your R Shiny app. You can extend the app's look and feel by tailoring the UI, add more interactive elements and graphs to your dashboard, or even implement more complex server-side logic. 

Be open to experiments. Make your analysis more interactive, comprehensive, and powerful with WebDataRocks for R. 

Code 

Find the R wrapper for WebDataRocks Pivot Table on GitHub

Move up

Read more articles by category Reporting and data analysis

Explore

Read more

Simple Way to Analyze Complex Data Online

Quickly transform complex data into meaningful insights with its drag-and-drop interface and advanced features. Learn about solution that is ideal for both developers and business users.

Article thumbnail

Top pivot table components for web reporting: guide for developers

We’ll review top pivot table components based on key criteria like documentation, performance, scalability, and customization. This guide will help you find the best fit for your project, whether you prioritize functionality, integration, or cost.

Article thumbnail

List of best JavaScript components for report application

Explore the best JavaScript components for building robust report applications. This article covers top libraries like Chart.js, amCharts, Apache ECharts, D3.js, and more, comparing their features, pros, and cons to help you find the right data visualization and reporting tools for your business needs.

Back to Blog