Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.
The rgl package has been used to produce rich, interactive 3D graphics within R using the OpenGL framework for some time. The rgl authors also added the ability to export to WebGL, allowing R authors to produce interactive 3D graphics that were accessible from within any modern web browser.
This functionality can now be leveraged within the Shiny framework using the new shinyRGL package — allowing users of R who may have no prior web development experience to create interactive web applications which incorporate 3D graphics. Examples such as this 3D cube filled with variable numbers of points or this modification of the ‘bivar’ example included in rgl can be produced with minimal effort. (The source code for both of these applications is available in the /examples/ directory of the shinyRGL package; both are under 100 lines of code and are written entirely in R.)
The package was just released on CRAN and should now be available from your preferred CRAN mirror. You can install using the command:
install.packages("shinyRGL")
Alternatively, you can download the bleeding-edge version of the code, view more details about the implementation, or track the development of the package on our GitHub repository. Please use GitHub to notify us of any issues or feature requests you may come across, as well.
Below is a sample of the kinds of graphics that can be produced using shinyRGL by writing only R code. Be sure to pan the scene by clicking and dragging, zoom using the scroll wheel, and even change the point of view by clicking and dragging with the right mouse button. < canvas id="wClOVTFhoPtextureCanvas" style="display: none;" width="256" height="256"> Your browser does not support the HTML5 canvas element. < !-- ****** points object 12 ****** --> < !-- ****** lines object 14 ****** --> < !-- ****** text object 15 ****** --> < !-- ****** lines object 16 ****** --> < !-- ****** text object 17 ****** --> < !-- ****** lines object 18 ****** --> < !-- ****** text object 19 ****** --> < !-- ****** lines object 20 ****** --> < canvas id="wClOVTFhoPcanvas" width="1" height="1">
You must enable Javascript to view this page properly.
R-bloggers.com offers daily e-mail updates about R news and tutorials about learning R and many other topics. Click here if you're looking to post or find an R/data-science job.
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.