❯ usethis::use_pkgdown_travis()
✔ Setting active project to '/Users/gaborcsardi/works/ps'
✔ Adding 'docs/' to '.gitignore'
● Set up deploy keys by running `travis::use_travis_deploy()`
● Insert the following code in '.travis.yml'
before_cache: Rscript -e 'remotes::install_cran("pkgdown")'
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> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8"/> | |
<style>body{background-color:white;}</style> | |
</head> | |
<html> | |
<head> | |
<title>Title</title> | |
<link rel="stylesheet" href="https://unpkg.com/[email protected]/dist/leaflet.css" |
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
require(quantmod) | |
do_chart <- function(symbol) { | |
quote <- getQuote(symbol) | |
quote$Close <- quote$Last | |
xts(OHLCV(quote), quote[,"Trade Time"], | |
pct_change = quote[,"% Change"]) | |
} | |
filename <- "intraday-sp500.rds" |
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: The most up-to-date version of this function is now available at | |
# https://github.com/rok-cesnovar/misc/blob/master/expose-cmdstanr-functions/expose_cmdstanr_functions.R | |
# | |
#' Function to expose Stan user-defined functions in R using CmdStanr and Rcpp. | |
#' | |
#' In addition to all user-defined functions, this function will expose the | |
#' stan_rng__(seed) function, that can be used to supplied specific seeds to | |
#' Stan RNG UDFs. |
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
## Get current Apple COVID data | |
## Kieran Healy / @kjhealy | |
## E.g. apple_covid <- get_apple_data() | |
## 1. Find today's URL | |
## Thanks to David Cabo (@dcabo) for alerting me to the existence of the json file. | |
get_apple_target <- function(cdn_url = "https://covid19-static.cdn-apple.com", | |
json_file = "covid19-mobility-data/current/v3/index.json") { | |
tf <- tempfile(fileext = ".json") |
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(rlang) | |
#> Warning: package 'rlang' was built under R version 3.6.2 | |
generator <- function() { | |
# ~ 80mb | |
x <- 1:1e7 + 0 | |
# `x` is in this function env | |
function() { | |
1 |
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(RSelenium) | |
library(rvest) | |
library(tidyverse) | |
theme_set(theme_minimal(15) + | |
theme(plot.title.position = "plot", | |
plot.caption = element_text(color = "gray40", size = 8))) | |
url <- "https://www.nytimes.com/interactive/2020/us/coronavirus-us-cases.html" | |
rd <- rsDriver(browser = "chrome", chromever = "81.0.4044.69") |
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
# ---------------------------------------------------- | |
# Installing packages for new R version. | |
# Michael DeCrescenzo | |
# | |
# Hi, I'm a political science PhD student looking for | |
# a data science/quantitative research/statistics job. | |
# Learn more at <mikedecr.github.io> and <github.com/mikedecr> | |
# | |
# This script deals with the following problem: | |
# I upgraded to new major version of R, & I want to reinstall packages. |
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
--- | |
title: "COVID-19 Case Fatality Rate (CFR) by age" | |
output: html_document | |
--- | |
```{r setup, include=FALSE} | |
knitr::opts_chunk$set(echo = TRUE) | |
library(tidyverse) | |
``` |
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
rm(list = ls()) | |
library(tidyverse) | |
library(ggrepel) | |
covid <- | |
read_csv(file = "https://raw.githubusercontent.com/CSSEGISandData/COVID-19/master/csse_covid_19_data/csse_covid_19_time_series/time_series_19-covid-Confirmed.csv") | |
covid <- | |
covid %>% filter(`Country/Region` != "Cruise Ship") | |
covid_long <- |