This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!DOCTYPE html> | |
| <script src="../lib/d3.min.js"></script> | |
| <svg id="chart"></svg> | |
| <script> | |
| var data = [5, 25, 15, 20, 10]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!DOCTYPE html> | |
| <script src="../lib/d3.min.js"></script> | |
| <div id="chart"></div> | |
| <script> | |
| var data = [5, 25, 15, 20, 10]; | |
| d3.select("#chart") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!DOCTYPE html> | |
| <style> | |
| #chart div { | |
| background-color: brown; | |
| height: 25px; | |
| margin: 5px; | |
| } | |
| </style> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!DOCTYPE html> | |
| <canvas id="chart" width="250" height="200"></canvas> | |
| <script> | |
| var data = [5, 25, 15, 20, 10]; | |
| var canvas = document.getElementById("chart"); | |
| var ctx = canvas.getContext("2d"); | |
| ctx.fillStyle = "brown"; | |
| for (i = 0; i < data.length; i++){ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!DOCTYPE html> | |
| <svg class="chart" width="250" height="200" fill="brown" > | |
| <rect x="0" y="0" width="50" height="25"></rect> | |
| <rect x="0" y="30" width="250" height="25"></rect> | |
| <rect x="0" y="60" width="150" height="25"></rect> | |
| <rect x="0" y="90" width="200" height="25"></rect> | |
| <rect x="0" y="120" width="100" height="25"></rect> | |
| </svg> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!DOCTYPE html> | |
| <style> | |
| #chart div { | |
| background-color: brown; | |
| height: 25px; | |
| margin: 5px; | |
| } | |
| </style> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| library(dplyr) | |
| library(ggplot2) | |
| library(rbokeh) | |
| ######################## | |
| # Layering | |
| ######################## | |
| # Histogram & Density Plot - Price | |
| ggplot(diamonds) + aes(price, y = ..density..) + |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Load the library | |
| library(ggplot2) | |
| library(ggmap) | |
| # Create a dummy data frame of points | |
| set.seed(500) | |
| df <- round(data.frame( | |
| lon = jitter(rep( 77.59, 50), amount = .3), | |
| lat = jitter(rep( 12.97, 50), amount = .3) | |
| ), digits = 2) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ## Scraper One | |
| library(rvest) | |
| url = "http://nuforc.org/webreports/ndxe201507.html" | |
| pg <- html(url) | |
| nodes <- html_nodes(pg, "table") | |
| table <- html_table(nodes) | |
| str(table) | |
| View(table) | |
| # Alternate pipe function |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| library(ggplot2) | |
| ?mpg | |
| head(mpg) | |
| str(mpg) | |
| # Identify a scatter point | |
| attach(mtcars) | |
| plot(mpg, wt) | |
| identify(x = mpg, y = wt, n = 3, label = row.names(mtcars)) | |
| detach(mtcars) |