Giter Site home page Giter Site logo

hrbrmstr / processing.r Goto Github PK

View Code? Open in Web Editor NEW

This project forked from processing-r/processing.r

0.0 2.0 0.0 107.74 MB

R Language Mode in Processing for Creative Coding, created by @gaocegege, maintained by @jeremydouglass

Home Page: https://processing-r.github.io/

License: GNU General Public License v3.0

Java 88.55% Shell 2.56% Batchfile 0.44% Python 3.25% R 4.29% HTML 0.15% Dockerfile 0.76%

processing.r's Introduction

logo

Processing.R enables users to write Processing sketches in R.

Current Maintainer: @jeremydouglass from U. California Santa Barbara

Travis CI appveyor Codacy Badge

Overview

Processing.R is a mode for Processing that enables users to write Processing sketches using the R language. The mode can be installed in the Processing Development Environment (PDE). It can also run on the command line as a stand-alone jar.

Processing.R supports:

  1. native R programming and syntax
  2. most Processing built-in functions (draw(), rect(), box(), etc.)
  3. importing select Processing(Java) libraries (e.g. "peasycam")
  4. importing select R Packages (e.g. "foreach")
Editor

Early Development

Processing.R is still in early development -- it is not feature-complete or production-ready. Please try our experimental mode and give us your feedback.

Installation

Processing.R is currently available via PDE > Add Tool > Modes, you could install the mode in PDE.

To build the mode from source, see compilation.md.

Built-in functions in Processing

Processing.R supports most of the Processing functions as described in the Processing reference. Processing.R functions are described on the documentation website:

However, the Processing.R documentation is currently incomplete. Many functions have not been tested or are not accompanied by example sketches. Some reference pages contain materials from Processing.py or Processing(Java) that have not been edited to reflect differences from other Processing modes.

Processing Libraries: importLibrary()

Processing.R supports importing standard Processing(Java) libraries that enrich the functionality of Processing. The function importLibrary() imports new libraries manually. This has been tested with one library: peasycam, the "dead-simple mouse-driven camera for Processing."

Before trying the example code below, first install the corresponding library peasycam -- for example using the PDE Contribution Manager > Library.

settings <- function() {
    importLibrary("peasycam")
    size(200, 200, P3D)
}

setup <- function() {
    cam = PeasyCam$new(processing, 100)
    cam$setMinimumDistance(50)
    cam$setMaximumDistance(500)
}

draw <- function() {
    rotateX(-.5)
    rotateY(-.5)
    background(0)
    fill(255, 0, 0)
    box(30)
    pushMatrix()
    translate(0, 0, 20)
    fill(0, 0, 255)
    box(5)
    popMatrix()
}

R Packages: library()

Processing.R has limited support for R packages. It will automatically download R packages that are requested using the library() function, so you can use packages directly.

Here is an example using the foreach package:

library(foreach)

foreach(i=1:3) %do%
    print(sqrt(i))

In practice we have only found a few R packages so far that work with Processing.R "out of the box." This is because the package must be pure R and all of its dependencies must also be pure R. There is renjin list of R packages which lists their compatibility with the renjin JVM. Any package fully supported in renjin is theoretically supported in Processing.R.

Documentation

See https://processing-r.github.io/. The documentation is generated from https://github.com/processing-r/Processing.R-docs-tools.

Papers

CONTRIBUTING

Feel free to hack on Processing.R! development.md will help you to get involved into the development of Processing.R.

CHANGELOG

See CHANGELOG

AUTHORS

See AUTHORS

Acknowledgments

  • Thanks processing for the Processing Development Environment(PDE).
  • Thanks renjin for its awesome JVM-based interpreter for the R language.
  • Thanks Jeremy Douglass for mentoring me in Google Summer of Code 2017.

processing.r's People

Contributors

gaocegege avatar hawkingrei avatar jeremydouglass avatar

Watchers

 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.