Loading...
 

R_demo


R_demo demonstrates common uses of R to produce advanced and/or interactive graphs and reports in web pages within a full Wiki CMS/Groupware site, through the usage of PluginR (https://doc.tiki.org/PluginR).

There are a few sets of pages already created to show off some possibilities, as well as to allow quick starting new users into customizing their more complex interfaces to run their R scripts and packages through a nice Web 2.0 GUI:
  • Demo1_simple_test. Testing simple R commands to test that the installation went fine
    • Simple Text output
    • Simple graphical output
  • Demo2_params. Testing several other commands
    • Tiki Dynamic variable usage
    • Parsing html code
    • Wikisyntax param
  • Demo3_interface. Testing the process of working with datasets for a script to use them as parameters. The interface is organized in 4 tabas:
    1. Listing raw datasets
      • This first tab uses the standard output of Plugin TrackerList to display the data stored in the database of datasets ("Tracker" or items, in Tiki terms).
    2. Showing the results after the dataset is run
      • This part uses a Pretty Tracker with the (smarty) template in a wiki page, instead of just the standard output of Plugin TrackerList used in the first tab. Thus, the display is controlled by the (smarty) template "r_test3_template01", and it can be much more customized with the Wysiwyg editor in Tiki.
    3. Dataset edition (provided that a dataset is selected in the first tab)
      • This third tab allows the user to edit the parameters for the graph generated by the R script, by means of using Plugin Tracker to preload a previous item when requested (itemId value must be assigned in the url).
    4. Inserting new datasets
      • This last tab allows to insert new items, by means of using Plugin Tracker, despite the fact that the page has already loaded a previous item or not.
  • Demo4_export. Testing the production of a basic image with svg and pdf export. (in the future, extended with the help of other R packages)
  • Demo5_wordcloud. Testing some nice graphs from R. You might need some extra packages for R:
    • Word-cloud art
  • Demo6_googleVis. Testing some nice interactive graphs
    • Created through the googleVis package. You might need some extra R packages.
  • Demo7_plot.ly. Testing Plot.ly (see https://plot.ly/ ). The Plotly R graphing library allows you to create and share interactive, publication-quality plots in your browser. Plotly is also built for working together, and makes it easy to post graphs and data publicly with a URL or privately to collaborators.
  • Demo8_customoutput. Testing the customoutput parameter.
    • Introduced in PluginR v0.87, customoutput produces no hardcoded graphical output from PluginR, but leaves the R script inside the plugin to manage chart generation. In a later step, image is displayed with either img for images, or mediaplayer for pdf's, videos, etc.
  • Demo9_rcharts. Testing a series of examples of nice charts using rCharts and the corresponding javascript library used in each case. rCharts is an R package to create, customize and publish interactive javascript visualizations from R using a familiar lattice style plotting interface.
  • Demo10_clickme. Testing the clickme package from Nacho Caballero. Clickme is an R package that lets you create interactive visualizations in the browser directly from your R session.
  • Demo11_animation. Showing a way to produce a self-moving chart with data from different decades using the ggplot2 and animation packages.
  • Demo12_ecoengine. Testing the ecoengine package from rOpenSci, which is a collaborative effort to develop R-based tools for facilitating Open Science. Some distribution maps is generated for a species using LeafletJS, as well as a photo gallery created from a queried species for demostration purposes.
  • Demo13_parse_body. Testing the parse_body param from PluginR v 0.81.2+, which facilitates a better communication between data collected in trackers andits usage in R
  • Demo14_webshot. Testing the webshot package. Webshot makes it easy to take screenshots of web pages (all or sections defined by css selectors) from R, and save them as png or pdf. (requires PhantomJS, installable from within the webshot R package).
  • Demo15_pivottables. Testing the rpivotTable package, which is an R htmlwidget built around the pivottable library. PivotTable.js is a Javascript Pivot Table library with drag'n'drop functionality built on top of jQuery/jQueryUI and written in CoffeeScript by Nicolas Kruchten at Datacratic. It is available under an MIT license.

This menu will be created also: Profile_r_demo_menupage

Requirements:


New since August 2011:



These pages will be created:
(listed properly only when shown here: http://profiles.tiki.org/R_demo , not when you are at profile installation in your remote tiki site)




Trackers


YAML
preferences:
 feature_trackers: y
 trackerfield_file: y
 trackerfield_files: y
 trackerfield_dropdownother: y
 feature_user_watches: y 
 feature_view_tpl: n
 feature_edit_templates: y
 feature_wiki_templates: y
 feature_jquery_media: y
 wikiplugin_r: y
 wikiplugin_rr: y
 wikiplugin_aname: y
 feature_smileys: y
 feature_search_fulltext: y
 feature_wiki_argvariable: y
 feature_syntax_highlighter: y
 feature_syntax_highlighter_theme: default
 wiki_dynvar_style: double
 wikiplugin_div: y
 wikiplugin_group: y
 wikiplugin_iframe: y
 wikiplugin_img: y
 wikiplugin_pluginmanager: y
 wikiplugin_list: y
 wikiplugin_listpages: y
 wikiplugin_titlesearch: y
 wikiplugininline_div: y
 wikiplugininline_group: y
 wikiplugininline_iframe: y
 wikiplugininline_img: y
 wikiplugininline_fade: y
 wikiplugininline_remarksbox: y
 wikiplugininline_pluginmanager: y
 wikiplugininline_list: y
 wikiplugininline_listpages: y
 wikiplugininline_titlesearch: y
 feature_multilingual: y
 lang_use_db: y
instructions: Welcome to Plugin R
objects:
 -
  type: tracker
  ref: r_test_tracker1
  data:
   name: Datasets
   description: Files with data (like csv) to be processed by R scripts through tracker plugin calls
   default_status: open
   show: [ status, creation_date, modification_date, list_modification_date ]
   allow: [ comments, one_item_per_user, attachments ]
 -
  type: tracker_field
  ref: r_test_summary
  data:
   name: Summary
   tracker: $r_test_tracker1
   type: text_field
   flags: [ searchable, public, list, mandatory, link ]
   order: 10
 -
  type: tracker_field
  ref: r_test_description
  data:
   name: Description
   tracker: $r_test_tracker1
   type: text_area
   options: 1
   flags: [ public ]
   order: 20
 -
  type: tracker_field
  ref: r_test_from
  data:
   name: From user
   tracker: $r_test_tracker1
   type: user
   options: 1
   flags: [ searchable, public, list ]
   order: 30
 -
  type: tracker_field
  ref: r_test_attachment
  data:
   name: Dataset file
   tracker: $r_test_tracker1
   type: attachment
   flags: [ searchable, public, list ]
   order: 40
 -
  type: tracker_field
  ref: r_test_xmin
  data:
   name: Minimum value for axis X
   tracker: $r_test_tracker1
   type: text_field
   flags: [ searchable, public, list ]
   order: 50
 -
  type: tracker_field
  ref: r_test_xmax
  data:
   name: Maximum value for axis X
   tracker: $r_test_tracker1
   type: text_field
   flags: [ searchable, public, list ]
   order: 60


Groups & Permissions


YAML
permissions:
 Anonymous:
  allow: view
  deny: [ ]
 Registered:
  description: Will be ignored because group is already created
  allow:
   - create_tracker_items
   - list_trackers
   - view_trackers
   - watch_trackers
  deny: [  ]
  objects:
   -
    type: wiki_page
    id: r_test3_template01
    allow: use_as_template
   -
    type: wiki_page
    id: r_test13_template01
    allow: use_as_template
 Editors:
  description: Trusted users
  allow:
   - modify_tracker_items
   - trust_input
   - view_templates
   - edit_templates
   - use_content_templates
   - edit_content_templates
   - admin_content_templates
   - use_as_template
 Admins:
  description: Have all rights
  allow:
   - admin
   - trust_input



Sample data


YAML
objects:
 -
  type: tracker_item
  ref: dataset_001
  data:
   tracker: $r_test_tracker1
   status: open
   values:
    - [ $r_test_summary, Sample dataset ]
    - [ $r_test_from, admin ]
    - [ $r_test_description, "This dataset was created as part of the sample data for r_test." ]
    - [ $r_test_attachment, '']
    - [ $r_test_xmin, 1]
    - [ $r_test_xmax, 10]
 -
  type: tracker_item
  ref: dataset_002
  data:
   tracker: $r_test_tracker1
   status: pending
   values:
    - [ $r_test_summary, We are working on this dataset ]
    - [ $r_test_from, admin ]
    - [ $r_test_description, "This will soon be changed" ]
    - [ $r_test_attachment, '']
    - [ $r_test_xmin, 21]
    - [ $r_test_xmax, 30]
 -
  type: tracker_item
  ref: dataset_003
  data:
   tracker: $r_test_tracker1
   status: closed
   values:
    - [ $r_test_summary, A really old dataset ]
    - [ $r_test_from, admin ]
    - [ $r_test_description, "This dataset is outdated." ]
    - [ $r_test_attachment, '']
    - [ $r_test_xmin, 100]
    - [ $r_test_xmax, 110]


Modules

YAML
objects:
 -
  type: module
  ref: module_last_modif_tracker_items
  data:
   name: last_modif_tracker_items
   groups: [ Anonymous, Registered ]
   position: right
   order: 5
   params:
    trackerId: $r_test_tracker1
    name: Summary



Wiki pages


YAML
preferences:
  enable: [ feature_wiki ]
objects:
  -
    type: wiki_page
    ref:  r_test_instructions_page
    data:
      name: Welcome to Plugin R
      description: Basic intructions of PluginR and this profile
      lang: en
      mode: create_or_update
      content: wikicontent:Profile_r_test_instructions
  -
    type: wiki_page
    ref:  r_test1_page
    data:
      name: r_demo01_simple_test
      description: Interface to send datasets
      lang: en
      mode: create_or_update
      content: wikicontent:Profile_r_test1_simple_test
  -
    type: wiki_page
    ref:  r_test2_page
    data:
      name: r_demo02_params
      description: Interface to test several things
      lang: en
      mode: create_or_update
      content: wikicontent:Profile_r_test2_params
  -
    type: wiki_page
    ref:  r_test3_page
    data:
      name: r_demo03_interface
      description: Interface to change graph params and display png
      lang: en
      mode: create_or_update
      content: wikicontent:Profile_r_test3_interface
  -
    type: wiki_page
    ref:  r_test3_template01_page
    data:
      name: r_demo03_template01
      description: Template for wiki page
      lang: en
      mode: create_or_update
      content: wikicontent:Profile_r_test3_template01
  -
    type: wiki_page
    ref:  r_test4_page
    data:
      name: r_demo04_export
      description: Interface to test some export options for figures
      lang: en
      mode: create_or_update
      content: wikicontent:Profile_r_test4_export
  -
    type: wiki_page
    ref:  r_test5_page
    data:
      name: r_demo05_wordcloud
      description: Some examples of neat Cloud-art graphs to dogfood Tiki information
      lang: en
      mode: create_or_update
      content: wikicontent:Profile_r_test5_wordcloud
  -
    type: wiki_page
    ref:  r_test6_page
    data:
      name: r_demo06_googleVis
      description: Some examples of neat usage of RGoogleVis package
      lang: en
      mode: create_or_update
      content: wikicontent:Profile_r_test6_googleVis
  -
    type: wiki_page
    ref:  r_test7_page
    data:
      name: r_demo07_plot.ly
      description: Some examples of using Plot.ly
      lang: en
      mode: create_or_update
      content: wikicontent:Profile_r_test7_plot.ly
  -
    type: wiki_page
    ref:  r_test8_page
    data:
      name: r_demo08_customoutput
      description: Some examples of the usage of parameter customoutput producing either custom png or custom pdf displayed embedded within the same wiki page 
      lang: en
      mode: create_or_update
      content: wikicontent:Profile_r_test8_customoutput
  -
    type: wiki_page
    ref:  r_test9_page0
    data:
      name: r_demo09_rcharts
      description: series of examples of nice charts using the R package rCharts and the corresponding javascript library used in each case.
      lang: en
      mode: create_or_update
      content: wikicontent:Profile_r_test9_rcharts
  -
    type: wiki_page
    ref:  r_test9_page1
    data:
      name: r_demo09_rcharts_highcharts
      description: an example of nice charts using the R package rCharts and the corresponding javascript library HighCharts.
      lang: en
      mode: create_or_update
      content: wikicontent:Profile_r_test9_rcharts_highcharts
  -
    type: wiki_page
    ref:  r_test9_page2
    data:
      name: r_demo09_rcharts_leaflet
      description: an example of nice charts using the R package rCharts and the corresponding javascript library Leaflet.
      lang: en
      mode: create_or_update
      content: wikicontent:Profile_r_test9_rcharts_leaflet
  -
    type: wiki_page
    ref:  r_test9_page3
    data:
      name: r_demo09_rcharts_morris
      description: an example of nice charts using the R package rCharts and the corresponding javascript library MorrisJS.
      lang: en
      mode: create_or_update
      content: wikicontent:Profile_r_test9_rcharts_morris
  -
    type: wiki_page
    ref:  r_test9_page4
    data:
      name: r_demo09_rcharts_nvd3
      description: an example of nice charts using the R package rCharts and the corresponding javascript library NVD3.
      lang: en
      mode: create_or_update
      content: wikicontent:Profile_r_test9_rcharts_nvd3
  -
    type: wiki_page
    ref:  r_test9_page5
    data:
      name: r_demo09_rcharts_polychart
      description: an example of nice charts using the R package rCharts and the corresponding javascript library Polychart.
      lang: en
      mode: create_or_update
      content: wikicontent:Profile_r_test9_rcharts_polychart
  -
    type: wiki_page
    ref:  r_test9_page6
    data:
      name: r_demo09_rcharts_rickshaw
      description: an example of nice charts using the R package rCharts and the corresponding javascript library RickShaw.
      lang: en
      mode: create_or_update
      content: wikicontent:Profile_r_test9_rcharts_rickshaw
  -
    type: wiki_page
    ref:  r_test9_page7
    data:
      name: r_demo09_rcharts_xcharts
      description: an example of nice charts using the R package rCharts and the corresponding javascript library XCharts.
      lang: en
      mode: create_or_update
      content: wikicontent:Profile_r_test9_rcharts_xcharts
  -
    type: wiki_page
    ref:  r_test9_page8
    data:
      name: r_demo09_rcharts_512paths
      description: an example of nice charts using the R package rCharts and some js functions to produce an awesome chart from NY Times 512 Paths to the White House.
      lang: en
      mode: create_or_update
      content: wikicontent:Profile_r_test9_rcharts_512paths
  -
    type: wiki_page
    ref:  r_test10_page
    data:
      name: r_demo10_clickme
      description: Some examples with the Clickme R package that lets you create interactive visualizations in the browser directly from your R session
      lang: en
      mode: create_or_update
      content: wikicontent:Profile_r_test10_clickme
  -
    type: wiki_page
    ref:  r_test11_page
    data:
      name: r_demo11_animation
      description: An example of chart showing choropleths of different decades using R packages ggplot2 and animation
      lang: en
      mode: create_or_update
      content: wikicontent:Profile_r_test11_animation
  -
    type: wiki_page
    ref:  r_test12_page
    data:
      name: r_demo12_ecoengine
      description: Some distribution maps is generated for a species using LeafletJS, as well as a photo gallery created from a queried species for demostration purposes.
      lang: en
      mode: create_or_update
      content: wikicontent:Profile_r_test12_ecoengine
  -
    type: wiki_page
    ref:  r_test13_page
    data:
      name: r_demo13_parse_body
      description: Demostration of the usage of parameter parse_body
      lang: en
      mode: create_or_update
      content: wikicontent:Profile_r_test13_parse_body
  -
    type: wiki_page
    ref:  r_test13_template01_page
    data:
      name: r_demo13_template01
      description: Template for wiki page
      lang: en
      mode: create_or_update
      content: wikicontent:Profile_r_test3_template
  -
    type: wiki_page
    ref:  r_test14_page
    data:
      name: r_demo14_webshot
      description: Demostration of the usage of the Webshot R package
      lang: en
      mode: create_or_update
      content: wikicontent:Profile_r_test14_webshot
  -
    type: wiki_page
    ref:  r_test15_page
    data:
      name: r_demo15_pivottables
      description: Demostration of the usage of the rpivotTable R package (which uses PivotTable.js - a Javascript Pivot Table library with drag and drop functionality built on top of jQuery/jQueryUI and written in CoffeeScript by Nicolas Kruchten at Datacratic)
      lang: en
      mode: create_or_update
      content: wikicontent:Profile_r_test15_pivottables


Content Templates for pre-defined reports


YAML
objects:
 -
  type: template
  ref: content_template_report_01
  data:
   name: Report 01
   content: wikicontent:Profile_r_test_ContentTemplate_Report_01
   sections: [ wiki ]


Useful navigational aid

Wiki Page for the Menu

This will add the page Profile_r_test_menupage as the menu content

YAML
objects:
  -
    type: wiki_page
    ref: r_test_menupage_include
    data:
      name: Menu for R demo
      description: Collaborative simple menu
      lang: en
      mode: create_or_update
      content: wikicontent:Profile_r_demo_menupage


Module wiki side menu

YAML
objects:
 -
  type: module
  ref: module_menupage
  data:
   name: menupage
   position: right
   groups: [ Anonymous, Registered ]
   order: 2
   params:
    pagemenu: Menu for R demo



Links