View disgust_example.txt
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
"score" "condition" | |
13 "control" | |
26 "control" | |
30 "control" | |
23 "control" | |
34 "control" | |
37 "control" | |
33 "control" | |
34 "control" | |
35 "control" |
View dice_rolling.R
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(memoise) | |
# Rolls | |
k = 3 | |
# Sides | |
n = 5 | |
sumDist = function(n,k,maxn = n){ | |
do.call( |
View create_covers.R
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
#' Create cover images for talks from a folder of PDFs | |
#' | |
#' Requires imagemagick to be installed and in the path for the convert command | |
#' @param pdf_dir Directory containing PDF files of papers | |
#' @param img_dir Directory to output all the image files | |
#' @param crop_height How big to make the cropped images, relative to full page | |
#' @param fade_height How much of the image to fade to transparent at the bottom | |
#' @param density resolution for PNG images | |
#' | |
create_covers = function(pdf_dir, img_dir, crop_height = .5, fade_height = .25, density = 300){ |
View testing_ricv.Rmd
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
--- | |
title: "Testing ricv" | |
author: "Richard D. Morey" | |
date: "3/25/2022" | |
output: html_document | |
--- | |
```{r setup, include=FALSE} | |
knitr::opts_chunk$set(echo = FALSE) | |
``` |
View example.R
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(ggplot2) | |
# Create data | |
tibble( | |
g = rep(c('A','B'), each = 50), | |
z = rnorm(length(g)) | |
) |> | |
group_by(g) |> | |
mutate( |
View Lichtenstein_etal_1978_Tab5.csv
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
Cause | Rate_outof_205000000 | MVA_geom_mean | MVA_resid | Elec_geom_mean | Elec_resid | |
---|---|---|---|---|---|---|
Smallpox | 0.00 | 88.00 | 37.00 | |||
Poisoning by vitamins | 1.00 | 237.00 | 1.27 | 44.00 | 1.16 | |
Botulism | 2.00 | 379.00 | 1.97 | 88.00 | 1.96 | |
Measles | 5.00 | 331.00 | 1.39 | 85.00 | 1.47 | |
Fireworks | 6.00 | 331.00 | 1.54 | 77.00 | 1.26 | |
Smallpox vaccination | 8.00 | 38.00 | 0.17 | 14.00 | 0.22 | |
Whooping cough | 15.00 | 171.00 | 0.69 | 51.00 | 0.62 | |
Polio | 17.00 | 202.00 | 0.80 | 47.00 | 0.55 | |
Venomous bite or sting | 48.00 | 535.00 | 1.67 | 233.00 | 1.85 |
View subway_hist.R
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(ggplot2) | |
library(ggdist) | |
url = 'https://osf.io/846cb/download' | |
httr::GET(url, httr::write_disk(tf <- tempfile(fileext = ".xlsx"))) | |
readxl::read_xlsx(tf) %>% | |
mutate( | |
DIRECTION = factor(DIRECTION, levels = c("WEST","EAST"), |
View test_surveyjs.Rmd
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
--- | |
title: "Test SurveyJS and Rmarkdown" | |
output: | |
html_document: | |
css: "https://unpkg.com/survey-jquery/survey.min.css" | |
editor_options: | |
chunk_output_type: console | |
--- | |
A test javascript survey by building a JSON object for [SurveyJS](https://surveyjs.io/). |
View Bailey_Geary_2009.csv
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
No | homo | CC | Latitude | north | lat_from_o | tpar | meantemp | hitemp | lotemp | diftemp | Isosd | dpop_30 | |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | 1 | 595 | 27 | 0 | 35 | 1 | 17.8 | 30 | 1 | 29 | 0.218223437 | 13 | |
2 | 1 | 475 | 27 | 0 | 35 | 1 | 17.8 | 30 | 1 | 29 | 0.218223437 | 13 | |
3 | 1 | 507 | 27 | 0 | 35 | 1 | 17.8 | 30 | 1 | 29 | 0.218223437 | 13 | |
4 | 1 | 570 | 27 | 0 | 35 | 1 | 17.8 | 30 | 1 | 29 | 0.218223437 | 13 | |
6 | 1 | 776 | 4 | 1 | 4 | 7 | 24.7 | 26 | 11 | 15 | 0.212807364 | 13 | |
7 | 1 | 506.333 | 4 | 1 | 4 | 7 | 24.7 | 26 | 11 | 15 | 0.212807364 | 13 | |
8 | 1 | 622.5 | 4 | 1 | 4 | 7 | 24.7 | 26 | 11 | 15 | 0.212807364 | 13 | |
5 | 1 | 500 | 7 | 1 | 1 | 7 | 22.2 | 25 | 6 | 19 | 0.212807364 | 13 | |
15 | 1 | 775 | 40 | 1 | 32 | 4 | 5.8 | 31 | -1 | 32 | 0.25577606 | 16 |
View app2.R
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
# Test answer to https://stackoverflow.com/questions/68473292/prevent-double-execution-of-shiny-reactive-with-two-dependency-pathways/68475515#68475515 | |
library(shiny) | |
library(digest) | |
ui <- fluidPage( | |
sidebarLayout( | |
sidebarPanel( | |
textInput("M", "M:", ""), | |
uiOutput("S_UI"), |
NewerOlder