Code Monkey home page Code Monkey logo

river's Introduction

river

R visualizer - a convenient tool for bringing the power and beauty of plotting facilities implemented in the R language libraries to your data

Usage

Example of usage:

./source/main.r corpora/experiment

The command accepts two arguments - the first points to the folder with corpus data (the directory must contain at least two files - one with extension yml which declares desired plot properties and some corpus metadata and other contains the corpus data itself in the tsv format). The second parameter provides a path to the folder with images (may be omitted, by default this value is taken to be equal to images).

For the command above after the script execution a file with name images/experiment.jpeg will be generated.

At the same time the project is very easy to use from the R console as well which is a preferable option when working with interactive plotly diagrams. As you can see in the example below, a corpus can be easily imported and visualized using just one short expression.

source('source/utils.r')
'corpora/2d-electron-positions` %>% read %>% render

And if you want to save the generated image on a disk to make it a static asset, it's extremely simple as well

source('source/utils.r')
'corpora/2d-electron-positions` %>% read %>% render %>% draw("image.jpeg")

Prerequisities

The following instructions, commands and scripts are tested solely on Ubuntu 20.04. The installation must be executed only after setting your working directory to match the folder containing data from this repository.

  1. Installing R itself
sudo apt update -qq
sudo apt install --no-install-recommends software-properties-common dirmngr
wget -qO- https://cloud.r-project.org/bin/linux/ubuntu/marutter_pubkey.asc | sudo tee -a /etc/apt/trusted.gpg.d/cran_ubuntu_key.asc
sudo add-apt-repository "deb https://cloud.r-project.org/bin/linux/ubuntu $(lsb_release -cs)-cran40/"
  1. Installing system-level dependencies
sudo apt-get update && sudo apt-get install libcairo2-dev -y # required for installing hrbrthemes on ubuntu, for other OSes there must be analogous packages
conda install -c plotly plotly-orca # required for exporting images generated via plotly (currently this impacts 3d histograms)
  1. Installing R dependencies
./setup.sh # No output or messages saying that some packages were skipped mean that all required libraries are already installed

Examples

3d-histogram 2d-electron-positions 2d-electron-positions-rotated electron-positions x-expectation-value-c-based-plot sphere-volume-time-plot sphere-volume-error-plot x-expectation-value-n-based-plot

river's People

Contributors

zeionara avatar

Watchers

James Cloos avatar  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.