Git Product home page Git Product logo

cran-explorer's Introduction

CRAN Explorer

Explore CRAN packages in an interactive R Shiny app. You can see the application in action on shinyapps.io: https://nz-stefan.shinyapps.io/cran-explorer/.

The goal of this project is to demonstrate the development of a complete data service entirely written in the statistical programming language R. Besides this web application, the project includes the creation of a data refresh process (also written in R) that runs inside an AWS Docker container on a daily schedule. Additionally, efforts were made to develop this project in a reproducible way by controlling the operating environmentand the used R version (through Docker containers), a complete list of all required R packages and their specific versions (through packrat) with the intention to promote collaborative development and to reduce the friction of the setup process of R projects in heterogeneous development environments.

Shiny app

This web application is written using the R Shiny web framework. It demonstrates the use of custom HTML templates in Shiny apps to create a fancy user experience. The theme used in this app is made by Colorlib. The app was developed with best Shiny practices in mind, e.g. the use of Shiny modules. In total about 1,100 lines of code were written for this app in less than 80 hours. This time included app ideation and all required research of data sources, data preparation and its operationalisation, app development, design and how to best present the information.

Setup development environment

The development environment of this project is encapsulated in a Docker container.

  1. Install Docker. Follow the instructions on https://docs.docker.com/install/
  2. Open a console (or a terminal on a Mac). On Windows you can use the excellent Git Bash which comes with the installation of Git. Clone the GIT repository:
    git clone https://github.com/nz-stefan/cran-explorer.git
    
  3. Setup development Docker container:
    cd cran-explorer
    bin/setup-environment.sh
    
    You should see lots of container build messages. Building the container might take a few minutes.
  4. On Linux or Mac spin up the container using:
    bin/start_rstudio.sh
    
    On Windows run instead:
    bin/start_rstudio_win.sh
    
  5. Open http://localhost:8788 in your browser to start a new RStudio session
  6. Install the R packages required for this app. Type the following instructions into the R session window of RStudio:
    packrat::on()
    packrat::restore()
    
    The installation will take a while (around 30 minutes) as all packages are compiled from source. This will need to be done only once. The package library will be installed into the packrat/lib directory of the project path.
  7. Open the file app/global.R and hit the "Run app" button in the toolbar of the script editor (or type shiny::runApp("app") in the R session window). The Shiny app should open in a new window. You may need to instruct your browser to not block popup windows for this URL.

Data

The data for this app is extracted from MetaCRAN which provides a database of all packages on CRAN and their publication history. The extraction processes transforms and summarises the data for efficient consumption in this app. The app's data is refreshed through a separate R process which runs daily in a Docker container on AWS. The data refresh is published in its own git repository (to be published soon).

Deployment

The app is deployed through RStudio's webservice shinyapps.io. Additionally, the app is published on RStudio Cloud which provides a complete development environment of the project.

cran-explorer's People

Contributors

nz-stefan avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.