Coder Social home page Coder Social logo

rfun's Introduction

rfun

This utility will not be updated, and is superseded by the funr R package. You may use: install.packages("funr");library(funr);setup() to get started and visit funr's github page for more details.

r-fun(ction): attempt to make a fun cli for R

A small utility which wraps Rscript and provides access to all R functions from CLI.

install:

Download and place in ~/bin

chmod u+x ~/bin/rfun
export PATH=${PATH}:~/bin ## add to .bashrc

install method 2

## automatically placed in your bin, and updated when packages gets updated
install.packages('devtools')
devtools::install_github("sahilseth/flowr")

Using a base package

## ------- load help for rnorm
rfun rnorm
## ------- sample from rnorm
rfun rnorm n=100

Using a non-base package

Loading a package automatically by ::

## load help file for knitr
rfun knitr::knit
## OR use
rfun knitr::knit -h

Lets process a Rmd file

## get path to an example Rmd file. Assuming we have knitr installed.
## ------- save the filename in a BASH variable rmd
rmd=$(rfun system.file package=knitr ...=examples/knitr-minimal.Rmd)
echo $rmd
## knit this awesome example !
rfun knitr::knit input=$rmd

Features:

  • load help file to fetch arguments
  • Automatically load package before running using ::
  • Fetch all named parameters of the function and supply shell arguments after converting to the correct type

Note:

This was originally built for flowr and is a derivative of this file: https://github.com/sahilseth/flowr/blob/master/inst/scripts/flowr

I plan to keep these two in sync in case we find any bugs. In fact they are just alias on my systems.

rfun's People

Contributors

sahilseth avatar

Stargazers

 avatar

Watchers

 avatar James Cloos avatar

Forkers

yzharold

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.