🏳️🌈
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) # for data processing | |
| library(tidyr) # for data processing | |
| library(magick) # for image reading and OCR | |
| library(tesseract) # for OCR | |
| # read image | |
| dataimg <- magick::image_read("https://pbs.twimg.com/media/FBv8P8XXEBgCBvS?format=jpg&name=medium") | |
| # convert image to text | |
| text <- magick::image_ocr(dataimg) |
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: "True Plots" | |
| author: "Lisa DeBruine" | |
| date: "12/10/2021" | |
| output: html_document | |
| --- | |
| ```{r setup, include=FALSE} | |
| library(ggplot2) | |
| library(dplyr) |
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) | |
| library(faux) | |
| library(tidyr) | |
| library(purrr) | |
| library(ggplot2) | |
| library(glue) | |
| within_t <- function(n = 100, mu1 = 0, mu2 = 0, sd1 = 1, sd2 = 1, r = 0, | |
| alternative = c("two.sided", "less", "greater")) { | |
| x <- faux::rnorm_multi(n = 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(tidyverse) | |
| library(truncnorm) | |
| # transcribed table | |
| table2 <- tribble( | |
| ~question, ~non_mean, ~non_sd, ~aro_mean, ~aro_sd, ~p, | |
| "shoes", 42, 5.9, 65, 4.06, .001, | |
| "girl12", 23, 4.11, 46, 6.08, .001, | |
| "woman40", 58, 3.32, 77, 2.07, .001, | |
| "woman50", 28, 4.80, 55, 4.69, .001, |
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(faux) | |
| library(tidyverse) | |
| # simulate null data with realistic correlations | |
| dat <- sim_design( | |
| between = list(B = 0:1), | |
| within = list(W = 0:1), | |
| n = 100, | |
| r = 0.25, | |
| long = TRUE, |
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(googlesheets4) | |
| library(googledrive) | |
| library(testthat) | |
| library(dplyr) | |
| #' Append rows to a sheet safely | |
| #' | |
| #' Adds one or more new rows after the last row with data in a (work)sheet, | |
| #' handling data with new columns, missing columns, columns in a different order, | |
| #' or columns with a different data type. |
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(faux) | |
| library(afex) | |
| library(tidyverse) | |
| sd = 1.5 | |
| n = 95 | |
| r = .7 | |
| nsims = 1e2 | |
| roderingel <- sim_design( |
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(tidyverse) | |
| dat <- crossing(v = 1:10, r = seq(0, .9, .1)) %>% | |
| mutate(normies = map2_dbl(v, r, function(v, r) { | |
| faux::rnorm_multi(n = 10000, vars = v, r = r, empirical = TRUE) %>% | |
| filter_all(~(abs(.x) < 1)) %>% | |
| nrow() / 10000 | |
| }), | |
| r = as.character(r)) |
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(tidyverse) | |
| library(splithalf) | |
| library(faux) | |
| n_participants = 60 ## sample size | |
| n_trials = 80 | |
| n_blocks = 2 | |
| # your method ---- |
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 named item when unsure of name | |
| #' | |
| #' If a user gives you a named vector or list and there are a few possibilities for the item you want to get, list the possible names in order, using integers for indices. | |
| #' | |
| #' @param x named vector or list | |
| #' @param ... possible names in x in priority order | |
| #' @param .default default value if no names found | |
| #' | |
| #' @return list or vector item | |
| #' @export |