Skip to content

Instantly share code, notes, and snippets.

View cedricbatailler's full-sized avatar

Cedric Batailler cedricbatailler

View GitHub Profile
library(tidyverse)
library(rtweet)
twitter_auth <- rtweet_user()
auth_as(twitter_auth)
# rm followers ------------------------------------------------------------
possibly_slowly_unfollow_user <-
post_unfollow_user |>
possibly(otherwise = "fail") |>
lm_outliers <- function(data, formula, id, verbose = FALSE)
{
if (!requireNamespace("dplyr", quietly = TRUE)) {
stop("dplyr needed for this function to work. Please install it.",
call. = FALSE)
}
if (!requireNamespace("rlang", quietly = TRUE)) {
stop("rlang needed for this function to work. Please install it.",
call. = FALSE)
}
title author output
Moderated mediation sensitivity analysis
Cedric Batailler
github_document

Workspace

library(tidyverse)
library(patchwork)
library(Rcpp) # fix brms issue related to Rcpp namespace
# dataset
dataset <-
data_frame(id = 1:20,
y1 = rnorm(20),
y2 = rnorm(20),
y3 = rnorm(20))
library(tidyverse)
set.seed(123)
dataset <-
data.frame(group = rep(c("Group 1", "Group 2"), 25),
id = 1:50,
score = rnorm(50)) %>%
mutate(score = ifelse(group == "Group 1", score - 3, score)) %>%
add_row(group = "Group 1", id = "50", score = 2)
@cedricbatailler
cedricbatailler / experiment.js
Created February 18, 2018 09:17
sc-iat (good-bad vs. target)
// LICENCE -----------------------------------------------------------------------------
//
// Copyright 2018 - Cédric Batailler
//
// Permission is hereby granted, free of charge, to any person obtaining a copy of this
// software and associated documentation files (the "Software"), to deal in the Software
// without restriction, including without limitation the rights to use, copy, modify,
// merge, publish, distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to the following
// conditions: