You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In this module we will explore several ways to generate dynamic and interactive data displays. These include making maps and graphs that you can pan/zoom, select features for more information, and interact with in other ways. The most common output format is HTML, which can easily be embedded in a website (such as your final project!).
If you don't have the packages above, install them in the package manager or by running install.packages("doParallel").
DataTables
DataTables display R data frames as interactive HTML tables (with filtering, pagination, sorting, and search). This is a great way to make your raw data browsable without using too much space.
<script type="application/json" data-for="htmlwidget-5df978fd3f7ccaf1fe9e">{"x":{"elementid":"da7ba1810f5833d8ce48f210d936edec","modeltype":"Plot","modelid":"6e2445197878a52fcf46ea1afd04b546","docid":"df111eb2bc6e1a78c7f015fedf4f158d","docs_json":{"df111eb2bc6e1a78c7f015fedf4f158d":{"version":"0.12.2","title":"Bokeh Figure","roots":{"root_ids":["6e2445197878a52fcf46ea1afd04b546"],"references":[{"type":"Plot","id":"6e2445197878a52fcf46ea1afd04b546","attributes":{"id":"6e2445197878a52fcf46ea1afd04b546","plot_width":400,"plot_height":400,"sizing_mode":"scale_both","x_range":{"type":"Range1d","id":"948ada425c8019e8a2cf2c27f0b53b4a"},"y_range":{"type":"Range1d","id":"c7517c10066408ddf16c29b4522ccf1b"},"left":[{"type":"LinearAxis","id":"afdbf1a689b020f61498454449615074"}],"below":[{"type":"LinearAxis","id":"00a7e71f34f0a42ccb3b6fa81a584214"}],"right":[],"above":[],"renderers":[{"type":"BoxAnnotation","id":"10257aa14f289b86c1b8e1050a248520"},{"type":"GlyphRenderer","id":"4b24f7b0ffc47181f90234557c7ff7d6"},{"type":"GlyphRenderer","id":"db7844fda417b6ed9f222213c2e4af84"},{"type":"GlyphRenderer","id":"5f63198e21ef0041718bc349c2b70553"},{"type":"GlyphRenderer","id":"78ff104c512d026b7ab0259e6bf57848"},{"type":"GlyphRenderer","id":"74b15a97032f6786a1d9d679e63f9f5c"},{"type":"GlyphRenderer","id":"0f68b5736be473e5d13d03c5d4a1e08d"},{"type":"Legend","id":"1db855fb2ba38e69d65e1e1afc6d29e3"},{"type":"LinearAxis","id":"00a7e71f34f0a42ccb3b6fa81a584214"},{"type":"Grid","id":"f42e0c974ef7c1392fa15bd28fccdec3"},{"type":"LinearAxis","id":"afdbf1a689b020f61498454449615074"},{"type":"Grid","id":"0022f330173ffb5a4d66459d9c50c182"}],"extra_y_ranges":{},"extra_x_ranges":{},"tags":[],"min_border_left":4,"min_border_right":4,"min_border_top":4,"min_border_bottom":4,"lod_threshold":null,"toolbar":{"type":"Toolbar","id":"6263733484d6164a6ec9f3abe825f819"},"tool_events":{"type":"ToolEvents","id":"b95b17613e7fb54550de31688d5f74a4"}},"subtype":"Figure"},{"type":"Toolbar","id":"6263733484d6164a6ec9f3abe825f819","attributes":{"id":"6263733484d6164a6ec9f3abe825f819","tags":[],"active_drag":"auto","active_scroll":"auto","active_tap":"auto","tools":[{"type":"PanTool","id":"1b156595b85e734281782d6e21620baf"},{"type":"WheelZoomTool","id":"f4fc8744e63c280590cf877c196e4a65"},{"type":"BoxZoomTool","id":"302695f7b11ee19f2c3f35f1bfbe06c2"},{"type":"ResetTool","id":"d864ba586b1a2e7bf3dfd6c96f5d6f89"},{"type":"SaveTool","id":"17ace6d0a135227343bfa26d0b6bbec5"},{"type":"HelpTool","id":"2108bf2909a70531af9e824f71f15fde"},{"type":"HoverTool","id":"564ebc34dbdc746f1115aa446826efeb"},{"type":"HoverTool","id":"ac5a8c0946594566c767cc22654bd6b1"},{"type":"HoverTool","id":"1a8410ec33c28de78ac398cb1005ec17"}],"logo":null}},{"type":"PanTool","id":"1b156595b85e734281782d6e21620baf","attributes":{"id":"1b156595b85e734281782d6e21620baf","tags":[],"plot":{"type":"Plot","id":"6e2445197878a52fcf46ea1afd04b546","subtype":"Figure"},"dimensions":["width","height"]}},{"type":"ToolEvents","id":"b95b17613e7fb54550de31688d5f74a4","attributes":{"id":"b95b17613e7fb54550de31688d5f74a4","tags":[]},"geometries":[]},{"type":"WheelZoomTool","id":"f4fc8744e63c280590cf877c196e4a65","attributes":{"id":"f4fc8744e63c280590cf877c196e4a65","tags":[],"plot":{"type":"Plot","id":"6e2445197878a52fcf46ea1afd04b546","subtype":"Figure"},"dimensions":["width","height"]}},{"type":"BoxAnnotation","id":"10257aa14f289b86c1b8e1050a248520","attributes":{"id":"10257aa14f289b86c1b8e1050a248520","tags":[],"line_color":{"units":"data","value":"black"},"line_alpha":{"units":"data","value":1},"fill_color":{"units":"data","value":"lightgrey"},"fill_alpha":{"units":"data","value":0.5},"line_dash":[4,4],"line_width":{"units":"data","value":2},"level":"overlay","top_units":"screen","bottom_units":"screen","left_units":"screen","right_units":"screen","render_mode":"css"}},{"type":"BoxZoomTool","id":"302695f7b11ee19f2c3f35f1bfbe06c2","attributes":{"id":"302695f7b11ee19f2c3f35f1bfbe06c2","tags":[],"plot":{"type":"Plot","id":"6e2445197878a52fcf46ea1afd04b546","subtype":"Figure"},"overlay":{"type":"BoxAnnotation","id":"10257aa14f289b86c1b8e1050a248520"}}},{"type":"ResetTool","id":"d864ba586b1a2e7bf3dfd6c96f5d6f89","attributes":{"id":"d864ba586b1a2e7bf3dfd6c96f5d6f89","tags":[],"plot":{"type":"Plot","id":"6e2445197878a52fcf46ea1afd04b546","subtype":"Figure"}}},{"type":"SaveTool","id":"17ace6d0a135227343bfa26d0b6bbec5","attributes":{"id":"17ace6d0a135227343bfa26d0b6bbec5","tags":[],"plot":{"type":"Plot","id":"6e2445197878a52fcf46ea1afd04b546","subtype":"Figure"}}},{"type":"HelpTool","id":"2108bf2909a70531af9e824f71f15fde","attributes":{"id":"2108bf2909a70531af9e824f71f15fde","tags":[],"plot":{"type":"Plot","id":"6e2445197878a52fcf46ea1afd04b546","subtype":"Figure"},"redirect":"http://hafen.github.io/rbokeh","help_tooltip":"Click to learn more about rbokeh."}},{"type":"HoverTool","id":"564ebc34dbdc746f1115aa446826efeb","attributes":{"id":"564ebc34dbdc746f1115aa446826efeb","tags":[],"plot":{"type":"Plot","id":"6e2445197878a52fcf46ea1afd04b546","subtype":"Figure"},"renderers":[{"type":"GlyphRenderer","id":"4b24f7b0ffc47181f90234557c7ff7d6"}],"names":[],"anchor":"center","attachment":"horizontal","line_policy":"prev","mode":"mouse","point_policy":"snap_to_data","tooltips":[["Sepal.Length","@hover_col_1"],["Sepal.Width","@hover_col_2"]]}},{"type":"ColumnDataSource","id":"b3e0dcedff57409667a0c010962ebc84","attributes":{"id":"b3e0dcedff57409667a0c010962ebc84","tags":[],"column_names":["x","y","line_color","fill_color","hover_col_1","hover_col_2"],"selected":[],"data":{"x":[5.1,4.9,4.7,4.6,5,5.4,4.6,5,4.4,4.9,5.4,4.8,4.8,4.3,5.8,5.7,5.4,5.1,5.7,5.1,5.4,5.1,4.6,5.1,4.8,5,5,5.2,5.2,4.7,4.8,5.4,5.2,5.5,4.9,5,5.5,4.9,4.4,5.1,5,4.5,4.4,5,5.1,4.8,5.1,4.6,5.3,5],"y":[3.5,3,3.2,3.1,3.6,3.9,3.4,3.4,2.9,3.1,3.7,3.4,3,3,4,4.4,3.9,3.5,3.8,3.8,3.4,3.7,3.6,3.3,3.4,3,3.4,3.5,3.4,3.2,3.1,3.4,4.1,4.2,3.1,3.2,3.5,3.6,3,3.4,3.5,2.3,3.2,3.5,3.8,3,3.8,3.2,3.7,3.3],"line_color":["#1F77B4","#1F77B4","#1F77B4","#1F77B4","#1F77B4","#1F77B4","#1F77B4","#1F77B4","#1F77B4","#1F77B4","#1F77B4","#1F77B4","#1F77B4","#1F77B4","#1F77B4","#1F77B4","#1F77B4","#1F77B4","#1F77B4","#1F77B4","#1F77B4","#1F77B4","#1F77B4","#1F77B4","#1F77B4","#1F77B4","#1F77B4","#1F77B4","#1F77B4","#1F77B4","#1F77B4","#1F77B4","#1F77B4","#1F77B4","#1F77B4","#1F77B4","#1F77B4","#1F77B4","#1F77B4","#1F77B4","#1F77B4","#1F77B4","#1F77B4","#1F77B4","#1F77B4","#1F77B4","#1F77B4","#1F77B4","#1F77B4","#1F77B4"],"fill_color":["#1F77B4","#1F77B4","#1F77B4","#1F77B4","#1F77B4","#1F77B4","#1F77B4","#1F77B4","#1F77B4","#1F77B4","#1F77B4","#1F77B4","#1F77B4","#1F77B4","#1F77B4","#1F77B4","#1F77B4","#1F77B4","#1F77B4","#1F77B4","#1F77B4","#1F77B4","#1F77B4","#1F77B4","#1F77B4","#1F77B4","#1F77B4","#1F77B4","#1F77B4","#1F77B4","#1F77B4","#1F77B4","#1F77B4","#1F77B4","#1F77B4","#1F77B4","#1F77B4","#1F77B4","#1F77B4","#1F77B4","#1F77B4","#1F77B4","#1F77B4","#1F77B4","#1F77B4","#1F77B4","#1F77B4","#1F77B4","#1F77B4","#1F77B4"],"hover_col_1":["5.1","4.9","4.7","4.6","5.0","5.4","4.6","5.0","4.4","4.9","5.4","4.8","4.8","4.3","5.8","5.7","5.4","5.1","5.7","5.1","5.4","5.1","4.6","5.1","4.8","5.0","5.0","5.2","5.2","4.7","4.8","5.4","5.2","5.5","4.9","5.0","5.5","4.9","4.4","5.1","5.0","4.5","4.4","5.0","5.1","4.8","5.1","4.6","5.3","5.0"],"hover_col_2":["3.5","3.0","3.2","3.1","3.6","3.9","3.4","3.4","2.9","3.1","3.7","3.4","3.0","3.0","4.0","4.4","3.9","3.5","3.8","3.8","3.4","3.7","3.6","3.3","3.4","3.0","3.4","3.5","3.4","3.2","3.1","3.4","4.1","4.2","3.1","3.2","3.5","3.6","3.0","3.4","3.5","2.3","3.2","3.5","3.8","3.0","3.8","3.2","3.7","3.3"]}}},{"type":"Circle","id":"24333af7361d4778b904093206ce6104","attributes":{"id":"24333af7361d4778b904093206ce6104","tags":[],"size":{"units":"screen","value":10},"visible":true,"line_alpha":{"units":"data","value":1},"fill_alpha":{"units":"data","value":0.5},"x":{"units":"data","field":"x"},"y":{"units":"data","field":"y"},"line_color":{"units":"data","field":"line_color"},"fill_color":{"units":"data","field":"fill_color"}}},{"type":"Circle","id":"2af3906e7a314ff96273ce69c7fc4688","attributes":{"id":"2af3906e7a314ff96273ce69c7fc4688","tags":[],"size":{"units":"screen","value":10},"visible":true,"line_alpha":{"units":"data","value":1},"fill_alpha":{"units":"data","value":0.5},"x":{"units":"data","field":"x"},"y":{"units":"data","field":"y"},"line_color":{"units":"data","value":"#e1e1e1"},"fill_color":{"units":"data","value":"#e1e1e1"}}},{"type":"Circle","id":"3b55630652bcc4b3abde4f3140009231","attributes":{"id":"3b55630652bcc4b3abde4f3140009231","tags":[],"size":{"units":"screen","value":10},"visible":true,"line_alpha":{"units":"data","value":1},"fill_alpha":{"units":"data","value":1},"x":{"units":"data","field":"x"},"y":{"units":"data","field":"y"},"line_color":{"units":"data","field":"line_color"},"fill_color":{"units":"data","field":"fill_color"}}},{"type":"GlyphRenderer","id":"4b24f7b0ffc47181f90234557c7ff7d6","attributes":{"id":"4b24f7b0ffc47181f90234557c7ff7d6","tags":[],"selection_glyph":null,"nonselection_glyph":{"type":"Circle","id":"2af3906e7a314ff96273ce69c7fc4688"},"hover_glyph":{"type":"Circle","id":"3b55630652bcc4b3abde4f3140009231"},"name":null,"data_source":{"type":"ColumnDataSource","id":"b3e0dcedff57409667a0c010962ebc84"},"glyph":{"type":"Circle","id":"24333af7361d4778b904093206ce6104"}}},{"type":"HoverTool","id":"ac5a8c0946594566c767cc22654bd6b1","attributes":{"id":"ac5a8c0946594566c767cc22654bd6b1","tags":[],"plot":{"type":"Plot","id":"6e2445197878a52fcf46ea1afd04b546","subtype":"Figure"},"renderers":[{"type":"GlyphRenderer","id":"db7844fda417b6ed9f222213c2e4af84"}],"names":[],"anchor":"center","attachment":"horizontal","line_policy":"prev","mode":"mouse","point_policy":"snap_to_data","tooltips":[["Sepal.Length","@hover_col_1"],["Sepal.Width","@hover_col_2"]]}},{"type":"ColumnDataSource","id":"df24da7e82adc376728612fa8206f92f","attributes":{"id":"df24da7e82adc376728612fa8206f92f","tags":[],"column_names":["x","y","line_color","fill_color","hover_col_1","hover_col_2"],"selected":[],"data":{"x":[7,6.4,6.9,5.5,6.5,5.7,6.3,4.9,6.6,5.2,5,5.9,6,6.1,5.6,6.7,5.6,5.8,6.2,5.6,5.9,6.1,6.3,6.1,6.4,6.6,6.8,6.7,6,5.7,5.5,5.5,5.8,6,5.4,6,6.7,6.3,5.6,5.5,5.5,6.1,5.8,5,5.6,5.7,5.7,6.2,5.1,5.7],"y":[3.2,3.2,3.1,2.3,2.8,2.8,3.3,2.4,2.9,2.7,2,3,2.2,2.9,2.9,3.1,3,2.7,2.2,2.5,3.2,2.8,2.5,2.8,2.9,3,2.8,3,2.9,2.6,2.4,2.4,2.7,2.7,3,3.4,3.1,2.3,3,2.5,2.6,3,2.6,2.3,2.7,3,2.9,2.9,2.5,2.8],"line_color":["#FF7F0E","#FF7F0E","#FF7F0E","#FF7F0E","#FF7F0E","#FF7F0E","#FF7F0E","#FF7F0E","#FF7F0E","#FF7F0E","#FF7F0E","#FF7F0E","#FF7F0E","#FF7F0E","#FF7F0E","#FF7F0E","#FF7F0E","#FF7F0E","#FF7F0E","#FF7F0E","#FF7F0E","#FF7F0E","#FF7F0E","#FF7F0E","#FF7F0E","#FF7F0E","#FF7F0E","#FF7F0E","#FF7F0E","#FF7F0E","#FF7F0E","#FF7F0E","#FF7F0E","#FF7F0E","#FF7F0E","#FF7F0E","#FF7F0E","#FF7F0E","#FF7F0E","#FF7F0E","#FF7F0E","#FF7F0E","#FF7F0E","#FF7F0E","#FF7F0E","#FF7F0E","#FF7F0E","#FF7F0E","#FF7F0E","#FF7F0E"],"fill_color":["#FF7F0E","#FF7F0E","#FF7F0E","#FF7F0E","#FF7F0E","#FF7F0E","#FF7F0E","#FF7F0E","#FF7F0E","#FF7F0E","#FF7F0E","#FF7F0E","#FF7F0E","#FF7F0E","#FF7F0E","#FF7F0E","#FF7F0E","#FF7F0E","#FF7F0E","#FF7F0E","#FF7F0E","#FF7F0E","#FF7F0E","#FF7F0E","#FF7F0E","#FF7F0E","#FF7F0E","#FF7F0E","#FF7F0E","#FF7F0E","#FF7F0E","#FF7F0E","#FF7F0E","#FF7F0E","#FF7F0E","#FF7F0E","#FF7F0E","#FF7F0E","#FF7F0E","#FF7F0E","#FF7F0E","#FF7F0E","#FF7F0E","#FF7F0E","#FF7F0E","#FF7F0E","#FF7F0E","#FF7F0E","#FF7F0E","#FF7F0E"],"hover_col_1":["7.0","6.4","6.9","5.5","6.5","5.7","6.3","4.9","6.6","5.2","5.0","5.9","6.0","6.1","5.6","6.7","5.6","5.8","6.2","5.6","5.9","6.1","6.3","6.1","6.4","6.6","6.8","6.7","6.0","5.7","5.5","5.5","5.8","6.0","5.4","6.0","6.7","6.3","5.6","5.5","5.5","6.1","5.8","5.0","5.6","5.7","5.7","6.2","5.1","5.7"],"hover_col_2":["3.2","3.2","3.1","2.3","2.8","2.8","3.3","2.4","2.9","2.7","2.0","3.0","2.2","2.9","2.9","3.1","3.0","2.7","2.2","2.5","3.2","2.8","2.5","2.8","2.9","3.0","2.8","3.0","2.9","2.6","2.4","2.4","2.7","2.7","3.0","3.4","3.1","2.3","3.0","2.5","2.6","3.0","2.6","2.3","2.7","3.0","2.9","2.9","2.5","2.8"]}}},{"type":"Square","id":"7d51812fe50287b5d99010d0352f22e1","attributes":{"id":"7d51812fe50287b5d99010d0352f22e1","tags":[],"size":{"units":"screen","value":10},"visible":true,"line_alpha":{"units":"data","value":1},"fill_alpha":{"units":"data","value":0.5},"x":{"units":"data","field":"x"},"y":{"units":"data","field":"y"},"line_color":{"units":"data","field":"line_color"},"fill_color":{"units":"data","field":"fill_color"}}},{"type":"Square","id":"4ddcc1d3b8c30b6ab335997678af3113","attributes":{"id":"4ddcc1d3b8c30b6ab335997678af3113","tags":[],"size":{"units":"screen","value":10},"visible":true,"line_alpha":{"units":"data","value":1},"fill_alpha":{"units":"data","value":0.5},"x":{"units":"data","field":"x"},"y":{"units":"data","field":"y"},"line_color":{"units":"data","value":"#e1e1e1"},"fill_color":{"units":"data","value":"#e1e1e1"}}},{"type":"Square","id":"1dc9c7aa53ce983a5c9edf7f43fba815","attributes":{"id":"1dc9c7aa53ce983a5c9edf7f43fba815","tags":[],"size":{"units":"screen","value":10},"visible":true,"line_alpha":{"units":"data","value":1},"fill_alpha":{"units":"data","value":1},"x":{"units":"data","field":"x"},"y":{"units":"data","field":"y"},"line_color":{"units":"data","field":"line_color"},"fill_color":{"units":"data","field":"fill_color"}}},{"type":"GlyphRenderer","id":"db7844fda417b6ed9f222213c2e4af84","attributes":{"id":"db7844fda417b6ed9f222213c2e4af84","tags":[],"selection_glyph":null,"nonselection_glyph":{"type":"Square","id":"4ddcc1d3b8c30b6ab335997678af3113"},"hover_glyph":{"type":"Square","id":"1dc9c7aa53ce983a5c9edf7f43fba815"},"name":null,"data_source":{"type":"ColumnDataSource","id":"df24da7e82adc376728612fa8206f92f"},"glyph":{"type":"Square","id":"7d51812fe50287b5d99010d0352f22e1"}}},{"type":"HoverTool","id":"1a8410ec33c28de78ac398cb1005ec17","attributes":{"id":"1a8410ec33c28de78ac398cb1005ec17","tags":[],"plot":{"type":"Plot","id":"6e2445197878a52fcf46ea1afd04b546","subtype":"Figure"},"renderers":[{"type":"GlyphRenderer","id":"5f63198e21ef0041718bc349c2b70553"}],"names":[],"anchor":"center","attachment":"horizontal","line_policy":"prev","mode":"mouse","point_policy":"snap_to_data","tooltips":[["Sepal.Length","@hover_col_1"],["Sepal.Width","@hover_col_2"]]}},{"type":"ColumnDataSource","id":"307282d4b9fff68ef078bde41075132f","attributes":{"id":"307282d4b9fff68ef078bde41075132f","tags":[],"column_names":["x","y","line_color","fill_color","hover_col_1","hover_col_2"],"selected":[],"data":{"x":[6.3,5.8,7.1,6.3,6.5,7.6,4.9,7.3,6.7,7.2,6.5,6.4,6.8,5.7,5.8,6.4,6.5,7.7,7.7,6,6.9,5.6,7.7,6.3,6.7,7.2,6.2,6.1,6.4,7.2,7.4,7.9,6.4,6.3,6.1,7.7,6.3,6.4,6,6.9,6.7,6.9,5.8,6.8,6.7,6.7,6.3,6.5,6.2,5.9],"y":[3.3,2.7,3,2.9,3,3,2.5,2.9,2.5,3.6,3.2,2.7,3,2.5,2.8,3.2,3,3.8,2.6,2.2,3.2,2.8,2.8,2.7,3.3,3.2,2.8,3,2.8,3,2.8,3.8,2.8,2.8,2.6,3,3.4,3.1,3,3.1,3.1,3.1,2.7,3.2,3.3,3,2.5,3,3.4,3],"line_color":["#2CA02C","#2CA02C","#2CA02C","#2CA02C","#2CA02C","#2CA02C","#2CA02C","#2CA02C","#2CA02C","#2CA02C","#2CA02C","#2CA02C","#2CA02C","#2CA02C","#2CA02C","#2CA02C","#2CA02C","#2CA02C","#2CA02C","#2CA02C","#2CA02C","#2CA02C","#2CA02C","#2CA02C","#2CA02C","#2CA02C","#2CA02C","#2CA02C","#2CA02C","#2CA02C","#2CA02C","#2CA02C","#2CA02C","#2CA02C","#2CA02C","#2CA02C","#2CA02C","#2CA02C","#2CA02C","#2CA02C","#2CA02C","#2CA02C","#2CA02C","#2CA02C","#2CA02C","#2CA02C","#2CA02C","#2CA02C","#2CA02C","#2CA02C"],"fill_color":["#2CA02C","#2CA02C","#2CA02C","#2CA02C","#2CA02C","#2CA02C","#2CA02C","#2CA02C","#2CA02C","#2CA02C","#2CA02C","#2CA02C","#2CA02C","#2CA02C","#2CA02C","#2CA02C","#2CA02C","#2CA02C","#2CA02C","#2CA02C","#2CA02C","#2CA02C","#2CA02C","#2CA02C","#2CA02C","#2CA02C","#2CA02C","#2CA02C","#2CA02C","#2CA02C","#2CA02C","#2CA02C","#2CA02C","#2CA02C","#2CA02C","#2CA02C","#2CA02C","#2CA02C","#2CA02C","#2CA02C","#2CA02C","#2CA02C","#2CA02C","#2CA02C","#2CA02C","#2CA02C","#2CA02C","#2CA02C","#2CA02C","#2CA02C"],"hover_col_1":["6.3","5.8","7.1","6.3","6.5","7.6","4.9","7.3","6.7","7.2","6.5","6.4","6.8","5.7","5.8","6.4","6.5","7.7","7.7","6.0","6.9","5.6","7.7","6.3","6.7","7.2","6.2","6.1","6.4","7.2","7.4","7.9","6.4","6.3","6.1","7.7","6.3","6.4","6.0","6.9","6.7","6.9","5.8","6.8","6.7","6.7","6.3","6.5","6.2","5.9"],"hover_col_2":["3.3","2.7","3.0","2.9","3.0","3.0","2.5","2.9","2.5","3.6","3.2","2.7","3.0","2.5","2.8","3.2","3.0","3.8","2.6","2.2","3.2","2.8","2.8","2.7","3.3","3.2","2.8","3.0","2.8","3.0","2.8","3.8","2.8","2.8","2.6","3.0","3.4","3.1","3.0","3.1","3.1","3.1","2.7","3.2","3.3","3.0","2.5","3.0","3.4","3.0"]}}},{"type":"Triangle","id":"0faa3aa13a21c349449bf9923f2ceec7","attributes":{"id":"0faa3aa13a21c349449bf9923f2ceec7","tags":[],"size":{"units":"screen","value":10},"visible":true,"line_alpha":{"units":"data","value":1},"fill_alpha":{"units":"data","value":0.5},"x":{"units":"data","field":"x"},"y":{"units":"data","field":"y"},"line_color":{"units":"data","field":"line_color"},"fill_color":{"units":"data","field":"fill_color"}}},{"type":"Triangle","id":"23286b15d25dae43bc8c131d0c12e7da","attributes":{"id":"23286b15d25dae43bc8c131d0c12e7da","tags":[],"size":{"units":"screen","value":10},"visible":true,"line_alpha":{"units":"data","value":1},"fill_alpha":{"units":"data","value":0.5},"x":{"units":"data","field":"x"},"y":{"units":"data","field":"y"},"line_color":{"units":"data","value":"#e1e1e1"},"fill_color":{"units":"data","value":"#e1e1e1"}}},{"type":"Triangle","id":"db2bba047ace6a2c2cd4dd90a00d0f41","attributes":{"id":"db2bba047ace6a2c2cd4dd90a00d0f41","tags":[],"size":{"units":"screen","value":10},"visible":true,"line_alpha":{"units":"data","value":1},"fill_alpha":{"units":"data","value":1},"x":{"units":"data","field":"x"},"y":{"units":"data","field":"y"},"line_color":{"units":"data","field":"line_color"},"fill_color":{"units":"data","field":"fill_color"}}},{"type":"GlyphRenderer","id":"5f63198e21ef0041718bc349c2b70553","attributes":{"id":"5f63198e21ef0041718bc349c2b70553","tags":[],"selection_glyph":null,"nonselection_glyph":{"type":"Triangle","id":"23286b15d25dae43bc8c131d0c12e7da"},"hover_glyph":{"type":"Triangle","id":"db2bba047ace6a2c2cd4dd90a00d0f41"},"name":null,"data_source":{"type":"ColumnDataSource","id":"307282d4b9fff68ef078bde41075132f"},"glyph":{"type":"Triangle","id":"0faa3aa13a21c349449bf9923f2ceec7"}}},{"type":"ColumnDataSource","id":"c2a568730e8393f49fe9eb3738395137","attributes":{"id":"c2a568730e8393f49fe9eb3738395137","tags":[],"column_names":["x","y"],"selected":[],"data":{"x":[null,null],"y":[null,null]}}},{"type":"Circle","id":"4fb9769a9a667888fca87076f1fa640a","attributes":{"id":"4fb9769a9a667888fca87076f1fa640a","tags":[],"size":{"units":"screen","value":0},"visible":true,"line_alpha":{"units":"data","value":1},"fill_alpha":{"units":"data","value":0.5},"line_color":{"units":"data","value":"#1F77B4"},"fill_color":{"units":"data","value":"#1F77B4"},"x":{"units":"data","field":"x"},"y":{"units":"data","field":"y"}}},{"type":"Circle","id":"bc08857452aea739e44098ff26ffc46d","attributes":{"id":"bc08857452aea739e44098ff26ffc46d","tags":[],"size":{"units":"screen","value":0},"visible":true,"line_alpha":{"units":"data","value":1},"fill_alpha":{"units":"data","value":0.5},"line_color":{"units":"data","value":"#e1e1e1"},"fill_color":{"units":"data","value":"#e1e1e1"},"x":{"units":"data","field":"x"},"y":{"units":"data","field":"y"}}},{"type":"Circle","id":"27d12ef6772ec2479910ca194d785541","attributes":{"id":"27d12ef6772ec2479910ca194d785541","tags":[],"size":{"units":"screen","value":0},"visible":true,"line_alpha":{"units":"data","value":1},"fill_alpha":{"units":"data","value":1},"line_color":{"units":"data","value":"#1F77B4"},"fill_color":{"units":"data","value":"#1F77B4"},"x":{"units":"data","field":"x"},"y":{"units":"data","field":"y"}}},{"type":"GlyphRenderer","id":"78ff104c512d026b7ab0259e6bf57848","attributes":{"id":"78ff104c512d026b7ab0259e6bf57848","tags":[],"selection_glyph":null,"nonselection_glyph":{"type":"Circle","id":"bc08857452aea739e44098ff26ffc46d"},"hover_glyph":{"type":"Circle","id":"27d12ef6772ec2479910ca194d785541"},"name":null,"data_source":{"type":"ColumnDataSource","id":"c2a568730e8393f49fe9eb3738395137"},"glyph":{"type":"Circle","id":"4fb9769a9a667888fca87076f1fa640a"}}},{"type":"Square","id":"8627f8aa5760cd04139ff2f863c9b2ed","attributes":{"id":"8627f8aa5760cd04139ff2f863c9b2ed","tags":[],"size":{"units":"screen","value":0},"visible":true,"line_alpha":{"units":"data","value":1},"fill_alpha":{"units":"data","value":0.5},"line_color":{"units":"data","value":"#FF7F0E"},"fill_color":{"units":"data","value":"#FF7F0E"},"x":{"units":"data","field":"x"},"y":{"units":"data","field":"y"}}},{"type":"Square","id":"b5430aa994aee6695eae2196f1e4f4e7","attributes":{"id":"b5430aa994aee6695eae2196f1e4f4e7","tags":[],"size":{"units":"screen","value":0},"visible":true,"line_alpha":{"units":"data","value":1},"fill_alpha":{"units":"data","value":0.5},"line_color":{"units":"data","value":"#e1e1e1"},"fill_color":{"units":"data","value":"#e1e1e1"},"x":{"units":"data","field":"x"},"y":{"units":"data","field":"y"}}},{"type":"Square","id":"655f80fb0cbf497720007f6e46fba055","attributes":{"id":"655f80fb0cbf497720007f6e46fba055","tags":[],"size":{"units":"screen","value":0},"visible":true,"line_alpha":{"units":"data","value":1},"fill_alpha":{"units":"data","value":1},"line_color":{"units":"data","value":"#FF7F0E"},"fill_color":{"units":"data","value":"#FF7F0E"},"x":{"units":"data","field":"x"},"y":{"units":"data","field":"y"}}},{"type":"GlyphRenderer","id":"74b15a97032f6786a1d9d679e63f9f5c","attributes":{"id":"74b15a97032f6786a1d9d679e63f9f5c","tags":[],"selection_glyph":null,"nonselection_glyph":{"type":"Square","id":"b5430aa994aee6695eae2196f1e4f4e7"},"hover_glyph":{"type":"Square","id":"655f80fb0cbf497720007f6e46fba055"},"name":null,"data_source":{"type":"ColumnDataSource","id":"c2a568730e8393f49fe9eb3738395137"},"glyph":{"type":"Square","id":"8627f8aa5760cd04139ff2f863c9b2ed"}}},{"type":"Triangle","id":"4befa891e4b7b407ccd6e185fddb8997","attributes":{"id":"4befa891e4b7b407ccd6e185fddb8997","tags":[],"size":{"units":"screen","value":0},"visible":true,"line_alpha":{"units":"data","value":1},"fill_alpha":{"units":"data","value":0.5},"line_color":{"units":"data","value":"#2CA02C"},"fill_color":{"units":"data","value":"#2CA02C"},"x":{"units":"data","field":"x"},"y":{"units":"data","field":"y"}}},{"type":"Triangle","id":"312509cafe4cd438edd6874b598c1b01","attributes":{"id":"312509cafe4cd438edd6874b598c1b01","tags":[],"size":{"units":"screen","value":0},"visible":true,"line_alpha":{"units":"data","value":1},"fill_alpha":{"units":"data","value":0.5},"line_color":{"units":"data","value":"#e1e1e1"},"fill_color":{"units":"data","value":"#e1e1e1"},"x":{"units":"data","field":"x"},"y":{"units":"data","field":"y"}}},{"type":"Triangle","id":"99ce6d963e7fa26e4d8479243b820d3a","attributes":{"id":"99ce6d963e7fa26e4d8479243b820d3a","tags":[],"size":{"units":"screen","value":0},"visible":true,"line_alpha":{"units":"data","value":1},"fill_alpha":{"units":"data","value":1},"line_color":{"units":"data","value":"#2CA02C"},"fill_color":{"units":"data","value":"#2CA02C"},"x":{"units":"data","field":"x"},"y":{"units":"data","field":"y"}}},{"type":"GlyphRenderer","id":"0f68b5736be473e5d13d03c5d4a1e08d","attributes":{"id":"0f68b5736be473e5d13d03c5d4a1e08d","tags":[],"selection_glyph":null,"nonselection_glyph":{"type":"Triangle","id":"312509cafe4cd438edd6874b598c1b01"},"hover_glyph":{"type":"Triangle","id":"99ce6d963e7fa26e4d8479243b820d3a"},"name":null,"data_source":{"type":"ColumnDataSource","id":"c2a568730e8393f49fe9eb3738395137"},"glyph":{"type":"Triangle","id":"4befa891e4b7b407ccd6e185fddb8997"}}},{"type":"Legend","id":"1db855fb2ba38e69d65e1e1afc6d29e3","attributes":{"id":"1db855fb2ba38e69d65e1e1afc6d29e3","tags":[],"plot":{"type":"Plot","id":"6e2445197878a52fcf46ea1afd04b546","subtype":"Figure"},"legends":[["Species",[]],[" setosa",[{"type":"GlyphRenderer","id":"78ff104c512d026b7ab0259e6bf57848"}]],[" versicolor",[{"type":"GlyphRenderer","id":"74b15a97032f6786a1d9d679e63f9f5c"}]],[" virginica",[{"type":"GlyphRenderer","id":"0f68b5736be473e5d13d03c5d4a1e08d"}]]],"location":"top_right"}},{"type":"Range1d","id":"948ada425c8019e8a2cf2c27f0b53b4a","attributes":{"id":"948ada425c8019e8a2cf2c27f0b53b4a","tags":[],"start":4.048,"end":8.152}},{"type":"Range1d","id":"c7517c10066408ddf16c29b4522ccf1b","attributes":{"id":"c7517c10066408ddf16c29b4522ccf1b","tags":[],"start":1.832,"end":4.568}},{"type":"LinearAxis","id":"00a7e71f34f0a42ccb3b6fa81a584214","attributes":{"id":"00a7e71f34f0a42ccb3b6fa81a584214","tags":[],"plot":{"type":"Plot","id":"6e2445197878a52fcf46ea1afd04b546","subtype":"Figure"},"axis_label":"Sepal.Length","formatter":{"type":"BasicTickFormatter","id":"dfd2af4ae662c3f01ccb9d548dc88c87"},"ticker":{"type":"BasicTicker","id":"36766ef9bac319a015c3d7b885fc7c2f"},"visible":true,"axis_label_text_font_size":"12pt"}},{"type":"BasicTickFormatter","id":"dfd2af4ae662c3f01ccb9d548dc88c87","attributes":{"id":"dfd2af4ae662c3f01ccb9d548dc88c87","tags":[]}},{"type":"BasicTicker","id":"36766ef9bac319a015c3d7b885fc7c2f","attributes":{"id":"36766ef9bac319a015c3d7b885fc7c2f","tags":[],"num_minor_ticks":5}},{"type":"Grid","id":"f42e0c974ef7c1392fa15bd28fccdec3","attributes":{"id":"f42e0c974ef7c1392fa15bd28fccdec3","tags":[],"dimension":0,"plot":{"type":"Plot","id":"6e2445197878a52fcf46ea1afd04b546","subtype":"Figure"},"ticker":{"type":"BasicTicker","id":"36766ef9bac319a015c3d7b885fc7c2f"}}},{"type":"LinearAxis","id":"afdbf1a689b020f61498454449615074","attributes":{"id":"afdbf1a689b020f61498454449615074","tags":[],"plot":{"type":"Plot","id":"6e2445197878a52fcf46ea1afd04b546","subtype":"Figure"},"axis_label":"Sepal.Width","formatter":{"type":"BasicTickFormatter","id":"6ea894b764c4f00a32543d455350aeed"},"ticker":{"type":"BasicTicker","id":"ec1f754c55ad11a86af6764038d8a2ab"},"visible":true,"axis_label_text_font_size":"12pt"}},{"type":"BasicTickFormatter","id":"6ea894b764c4f00a32543d455350aeed","attributes":{"id":"6ea894b764c4f00a32543d455350aeed","tags":[]}},{"type":"BasicTicker","id":"ec1f754c55ad11a86af6764038d8a2ab","attributes":{"id":"ec1f754c55ad11a86af6764038d8a2ab","tags":[],"num_minor_ticks":5}},{"type":"Grid","id":"0022f330173ffb5a4d66459d9c50c182","attributes":{"id":"0022f330173ffb5a4d66459d9c50c182","tags":[],"dimension":1,"plot":{"type":"Plot","id":"6e2445197878a52fcf46ea1afd04b546","subtype":"Figure"},"ticker":{"type":"BasicTicker","id":"ec1f754c55ad11a86af6764038d8a2ab"}}}]}}},"debug":false},"evals":[],"jsHooks":[]}</script>
Leaflet
Leaflet is a really powerful JavaScript library for creating dynamic maps that support panning and zooming along with various annotations like markers, polygons, and popups. The example below were adapted from the leaflet vignettes.
An R interface to the 'dygraphs' JavaScript charting library. Provides rich facilities for charting time-series data in R, including highly configurable series- and axis-display and interactive features like zoom/pan and series/point highlighting.
create a xts time series object as required by dygraph() using xts() and specify the vector of data and the date column (see ?xts for help).
use dygraph() to draw the plot
add a dyRangeSelector() with a dateWindow of c("2017-01-01", "2017-12-31")
Show Solution
# Convert to a xts time series object as required by dygraphdt=xts(d$tmax,order.by=d$date)
dygraph(dt, main="Daily Maximum Temperature in Buffalo, NY") %>%
dyRangeSelector(dateWindow= c("2017-01-01", "2017-12-31"))%>%
frameWidget(height=500)
Creates 'D3' 'JavaScript' network, tree, dendrogram, and Sankey graphs from 'R'.
library(igraph)
library(networkD3)
Load example network
This loads an example social network of friendships between 34 members of a karate club at a US university in the 1970s. See W. W. Zachary, An information flow model for conflict and fission in small groups, Journal of Anthropological Research 33, 452-473 (1977).
karate<- make_graph("Zachary")
wc<- cluster_walktrap(karate)
members<- membership(wc)
# Convert to object suitable for networkD3karate_d3<- igraph_to_networkD3(karate, group=members)
URL<- paste0(
"https://cdn.rawgit.com/christophergandrud/networkD3/",
"master/JSONdata//flare.json")
## Convert to list formatFlare<-jsonlite::fromJSON(URL, simplifyDataFrame=FALSE)
# Use subset of data for more readable diagramFlare$children=Flare$children[1:3]
radialNetwork(List=Flare, fontSize=10, opacity=0.9, height=400, width=400)
RGL provides 3D interactive graphics, including functions modelled on base graphics (plot3d(), etc.) as well as functions for constructing representations of geometric objects (cube3d(), etc.). You may need to install XQuartz.
library(rgl)
library(rglwidget)
library(htmltools)
# Load a low-resolution elevation dataset of a volcano
data(volcano)