Code Monkey home page Code Monkey logo

rvisidata's Introduction

rvisidata

The goal of rvisidata is to combine the power of Visidata, "A Swiss Army Chainsaw for Data", with R.

Installation

Visidata

You need to have Visidata installed. Please follow the official installation instructions provided here. If you already have python3 installed, the easiest way to install it is with pip3: pip3 install visidata.

To verify visidata is installed correctly, vd --version should print out the installed version.

Package

rvisidata can be installed with devtools from the official GitHub repo:

devtools::install_github('paulklemm/rvisidata')

Example

vd(iris)

How it Works

Internally, rvisidata writes the data frame as a csv file to a temporary folder and then loads it with visidata. Be therefore careful with very large data frames, because the writing process can take a while. It will delete the temporary file after the visidata session is closed.

I do not claim that this implementation is efficient or very elegant. But it works. Suggestions for making it faster are very welcome.

Options

This package supports integration with tmux.

The default behaviour is to open vd in a vertical pane above the current pane, if R is running in a tmux session.

To disable this, set:

options(rvisidata.cmd = FALSE)

If you're using the kitty terminal emulator (https://github.com/kovidgoyal/kitty), you can also open vd in a new tab within kitty, like this:

options(rvisidata.cmd = "kitty")

Advanced

To customize the way tmux or kitty set up this workspace (For example, opening vd in a new window rather than pane), you may supply your own shell script that invokes vd on your dataset.

Set:

options(rvisidata.cmd = "path/to/your/script")

Your script should take one argument, the filename to be opened.

For example, the following will open your dataframe in a vertical split above the R console window, and return focus back to R:

#!/bin/bash

filename=$1

tmux split-window -vb -p 70 "vd $filename" \; \
  select-pane -l

Limitations

Right now this tool only opens the data frame and discards any changes you make for two reasons: (1) you should do your data manipulation in R to have a reproducible analysis workflow and (2) it is easier to implement this way ๐Ÿ˜‡.

Credits

Visidata is designed and developed by Saul Pwanson (official GitHub repository).

rvisidata's People

Contributors

paulklemm avatar strazto avatar saulpw 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.