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
brew tap homebrew-ffmpeg/ffmpeg | |
brew install homebrew-ffmpeg/ffmpeg/ffmpeg --with-chromaprint / | |
--with-fdk-aac / | |
--with-game-music-emu / | |
--with-libbluray / | |
--with-libbs2b / | |
--with-libcaca / | |
--with-libgsm / | |
--with-libmodplug / | |
--with-librsvg / |
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) | |
if (getRversion() >= "3.6.0") { | |
set.seed(234) | |
} else { | |
# RNGversion("3.5.0") | |
set.seed(1) | |
} | |
# creating example data | |
n = 20 | |
ids = 1:n |
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(ActivityIndex) | |
library(fst) | |
library(lubridate) | |
library(data.table) | |
filename = system.file("extdata","sample_GT3X+.csv.gz", | |
package = "ActivityIndex") | |
res = ActivityIndex::ReadGT3XPlus(filename) | |
data = res$Raw | |
data$DT = paste(data$Date, data$Time) |
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
## Performs MCMC P-value calculation for 0-1 tables | |
## from Darwin's Finch data | |
set.seed(1) | |
I = 7; J = 5 | |
testDat = matrix(sample(0:1, I * J, replace= TRUE), I, J) | |
A = matrix(c( | |
0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 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(ggplot2) | |
library(plotly) | |
library(htmlwidgets) | |
make_card = function(handle = "@StrictlyStat", | |
title = "", | |
description = "", | |
img = NULL, | |
html = NULL, | |
height = 480, |
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(rsciinema) | |
input = paste0("library(magrittr); # a comment is a gra", backspace(), "eat thing to do", | |
"\niris %>% \n dplyr::group_by(Species) %>%\n ", | |
"dplyr::summarise_all(mean) \n # a new line") | |
data = asciicast( input ) | |
json = rsciinema::json_asciicast(data) |
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
# Nature article: https://www.nature.com/articles/d41586-018-06185-8 | |
library(rscopus) | |
library(lubridate) | |
library(dplyr) | |
x = author_data(first_name = "john", last_name = "Ioannidis") | |
df = x$df | |
df$date = ymd(df$`prism:coverDate`) | |
df$year = year(df$date) |
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(pdftools) | |
library(purrr) | |
res = pdftools::pdf_text("YG-Archive-DatingSocialMediaInternal-090818.pdf") | |
ss = strsplit(res, "\n") | |
names(ss) = 1:length(ss) | |
df = map_df(ss, function(x) { | |
data.frame(txt = x, | |
row = seq_along(x), | |
start = grepl("unweighted base", tolower(trimws(x))), | |
stringsAsFactors = FALSE) |
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(rsciinema) | |
data = asciicast( "# a comment\niris %>% \n dplyr::group_by(Species) %>%\n dplyr::summarise_all(mean)" ) | |
tfile= tempfile(fileext = ".cast") | |
write_asciicast(data, tfile) | |
asciinema( tfile ) |
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
# see http://www.opc.state.md.us/RegulatoryActivities/Publications.aspx | |
# https://webapp.psc.state.md.us/ecm/web/Compare_new1.cfm | |
library(rvest) | |
library(dplyr) | |
# doc = read_html("rates.html") | |
# tab = html_table(doc, header = TRUE)[[1]] | |
# tab = tab %>% | |
# rename( | |
# name = `Company Name3`, | |
# price = `Price/KWH`, |