Learn R Programming

jsReact

jsReact is designed to help you utilise JavaScript's visualisation libraries and R's modelling packages to build tailor-made interactive apps. The basic framework is set, and at the moment I am expanding on examples (see the 'example' folder) and tutorials (see 'vignettes'). Collaboration is welcomed!

For more information, see the website which contains tutorials, examples and package documentation.

Installation

jsReact is currently not available from CRAN, but you can install the development version from github with:

# install.packages("devtools")
devtools::install_github("kcf-jackson/jsReact")

Who might be interested in this package / repo ?

  • Experienced R users who have heard JS is powerful, attempted to learn it but found the barrier too high.

  • Researchers who are happy to step up their data visualisation game with JS, but still want to do modelling in R.

List of examples

Exploring the basics of the package

Exploring basic statistical models

Testing the power of the package

Examples created with specific goals in mind

Examples in action

Copy Link

Version

Version

0.2.4

License

MIT + file LICENSE

Issues

Pull Requests

Stars

Forks

Maintainer

Chun Fung (Jackson) Kwok

Last Published

December 9th, 2018

Functions in jsReact (0.2.4)

add_google_play_pause

Add a google-style play-pause button
add_column

Add a section (div element) to body
add_container

Add a container (div element) to body
add_js_library

Add js libraries src files to html header
add_pipe

Add 'pipes' to convert from and to JSON
JS_

Collapse lines into a string
add_vr_3d_points

Add VR multiple spheres from dataframe
add_button

Add slider to body
add_vr_asset_item

Add VR asset item
add_header_title

Add title to html header
add_google_style

Add google material icon
add_item

Add a item (div element) to body
add_google_style_button

Add a google-style single image button
add_vr_assets

Add VR assets
add_vr_entity

Add VR entity
add_counter

Add a counter with text
create_app

Create an interactive app
add_div

Add a section (div element) to body
create_html

Create a basic html file
preview_app

Preview app
add_dropdown_list

Add drop-down list to body
start_app

Run an interactive app
add_slider

Add slider to body
developing_html

Helper function to aid developing and testing html file
add_slider_with_text

Add a slider with text description (to body)
developing_r

Helper function to aid developing and testing R codes
insert_after

Insert a script after the tag of a vector of a html string
add_style_from_link

Add css style to html header
insert_before

Insert a script before the tag of a vector of html string
add_script_from_file

Add Javascript from file to body
add_vr_scene

Add VR scene
add_vr_sphere

Add VR sphere
add_script_from_link

Add Javascript from link
dots_to_arg

Convert dots into html tag attributes
add_style

Add css style to html header
get_tag_index

Get the first index of a tag in a vector of a html string
add_style_from_file

Add css style to html header
add_tag_into

Generic function to add a pair of enclosing "tags" to "script", then insert into "into" of "my_html"
add_widget

Generic function to produce widgets
insert_into

Generic function to insert a script into a tag of a html string
copy_assets

Copy assets to target directory
add_row

Add a section (div element) to body
insert_df

Insert x into vec0 at pos + 1
html5_elements

Create builders for html5 elements
add_script

Add Javascript to body
html_to_string

Convert html to string
add_text

Add text
insert_websockets

Insert a websocket connection and convert html to string.
add_title

Add title to body
js_src

Contains the JS libraries source links
create_ws_url

A wrapper to make an address a full link
write_html_to_file

Convert html to string
developing

Helper function to aid developing and testing codes
import_functions

Import functions from other package
insert

Insert x into vec0 at pos + 1
tweenr_example

Function to create example data shown in the tweenr package.