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 packages | |
library(maptools) | |
library(lubridate) | |
library(ggplot2) | |
# vector of all the days in 2017 | |
days <- seq(from = as.POSIXct("2017-01-01"), to = as.POSIXct("2017-12-31"), by = "days") | |
# coordinates of RDU airport | |
lon <- -78.788 |
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
devtools::install_github("ianmcook/weatherAlerts") | |
devtools::install_github("ianmcook/weatherAlertAreas") | |
library(weatherAlerts) | |
library(leaflet) | |
alerts <- getAlerts("TX") # takes about 20 seconds | |
severity <- alerts@data$severity | |
colorMap <- c(Minor = "green", |
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
alert('Hello world!'); |
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
devtools::install_github("ianmcook/weatherAlerts") | |
devtools::install_github("ianmcook/weatherAlertAreas") | |
library(weatherAlerts) | |
library(leaflet) | |
alerts <- getAlerts("FL") # takes about 30 seconds | |
severity <- alerts@data$severity | |
colorMap <- c(Minor = "green", |
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
# Copyright 2018 Cloudera, Inc. | |
# | |
# Licensed under the Apache License, Version 2.0 (the "License"); | |
# you may not use this file except in compliance with the License. | |
# You may obtain a copy of the License at | |
# | |
# http://www.apache.org/licenses/LICENSE-2.0 | |
# | |
# Unless required by applicable law or agreed to in writing, software | |
# distributed under the License is distributed on an "AS IS" BASIS, |
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
from pyspark.sql import SparkSession | |
from pyspark.sql.types import StructType, StructField, IntegerType, StringType, FloatType | |
from pyspark.sql.functions import col, round | |
spark = SparkSession.builder.master('local').getOrCreate() | |
games = spark.createDataFrame( | |
[ | |
(1, 'Monopoly', 'Elizabeth Magie', 1903, 8, 2, 6, 19.99), | |
(2, 'Scrabble', 'Alfred Mosher Butts', 1938, 8, 2, 4, 17.99), |
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
# closed box loudspeaker equations | |
Qtc <- 0.707 # you choose this; see LDC p.24 | |
Qts <- 0.40 # property of driver | |
fs <- 19 # property of driver | |
Vas <- 260 # property of driver | |
alpha <- (Qtc/Qts) ^ 2 - 1 | |
fc <- (Qtc * fs) / Qts |
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
# vented box loudspeaker equations | |
Qts <- 0.40 # property of driver | |
fs <- 19 # property of driver | |
Vas <- 260 # property of driver | |
# you choose an alignment, | |
# choose a QL (assume 7 for starters), | |
# then look up the following values | |
# in the appropriate table on LDC p.58-62: |
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
piece | base_diameter | height | weight | |
---|---|---|---|---|
King | 37.3086 | 95.1557 | 50.2774 | |
King | 36.9878 | 95.3598 | 51.5528 | |
King | 37.6846 | 94.8507 | 50.7298 | |
King | 37.4201 | 96.2158 | 50.9344 | |
King | 36.7413 | 95.5326 | 51.9347 | |
King | 36.8166 | 96.0273 | 51.2393 | |
King | 37.5822 | 95.8491 | 50.8103 | |
King | 37.4132 | 95.2667 | 52.2267 | |
King | 37.7643 | 94.9941 | 51.2417 |
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(weatherAlerts) | |
library(leaflet) | |
alerts <- getAlerts("NC") # takes a few seconds | |
alerts <- alerts[alerts$event == "Tornado Warning",] | |
leaflet() %>% | |
addTiles() %>% | |
addPolygons(data = alerts, color = "black", fillColor = "magenta", weight = 1) |
OlderNewer