This file contains 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
sunrise.set <- function (lat, long, date, timezone = "UTC", num.days = 1) | |
{ | |
lat.long <- matrix(c(long, lat), nrow = 1) | |
day <- as.POSIXct(date, tz = timezone) | |
sequence <- seq(from = day, length.out = num.days, by = "days") | |
sunrise <- sunriset(lat.long, sequence, direction = "sunrise", | |
POSIXct = TRUE) | |
sunset <- sunriset(lat.long, sequence, direction = "sunset", | |
POSIXct = TRUE) | |
ss <- data.frame(sunrise, sunset) |
This file contains 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
results <- tbl_df(as.data.frame(matrix(nrow=length(users), ncol=2))) | |
# what I would love | |
create_tbl_df(nrow=length(users), ncol=2) |
This file contains 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
# .Rprofile -- commands to execute at the beginning of each R session | |
# | |
# You can use this file to load packages, set options, etc. | |
# | |
# NOTE: changes in this file won't be reflected until after you quit | |
# and start a new session | |
# | |
require(ProjectTemplate) | |
This file contains 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(babynames) | |
library(dplyr) | |
library(ggplot2) | |
babynames <- babynames %>% tbl_df() | |
babynames %>% | |
filter(name == "Hilary" | name == "Hillary") %>% | |
filter(year >= 1950, sex == "F") %>% | |
ggplot(aes(x = year, y = prop, group = name, color = name)) + geom_line() |
This file contains 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(broom) | |
library(ggplot2) | |
dat <- data.frame(x = runif(50000)) %>% tbl_df() | |
res <- dat %>% bootstrap(100) %>% do(tidy(lm(x ~ 1, .))) | |
ggplot(res, aes(x = estimate)) + geom_histogram() |
This file contains 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
## prop.test gives pooled 2-sample proportion result | |
## glm w/ binomial family gives unpooled 2-sample proportion result | |
## lm and glm w/ gaussian family give unknown result | |
library(dplyr) | |
library(broom) | |
set.seed(12345) | |
## set up dataframe ------------------------- | |
n_A <- 5000 |
This file contains 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
ip-10-8-0-222:tech-site hilaryparker$ bundle install | |
Fetching gem metadata from https://rubygems.org/......... | |
Fetching version metadata from https://rubygems.org/.. | |
Fetching dependency metadata from https://rubygems.org/. | |
Rubygems 2.0.14.1 is not threadsafe, so your gems will be installed one at a time. Upgrade to Rubygems 2.1.0 or higher to enable parallel gem installation. | |
Using i18n 0.7.0 | |
Using json 1.8.3 | |
Using minitest 5.9.0 | |
Using thread_safe 0.3.5 | |
Using addressable 2.4.0 |