Skip to content

Instantly share code, notes, and snippets.

View kierisi's full-sized avatar
🦦

Jesse Mostipak kierisi

🦦
View GitHub Profile
# setup -------------------------------------------------------------------
library(tidymodels)
library(tidyverse)
library(baguette)
library(janitor)
library(DataExplorer)
library(here)
tidymodels_prefer()

Keybase proof

I hereby claim:

  • I am kierisi on github.
  • I am kierisi (https://keybase.io/kierisi) on keybase.
  • I have a public key ASC2gSdJ7EaW10tDGLbTpaUFHvOqQVR1gVgCsGX0F4iKFwo

To claim this, I am signing this object:

@kierisi
kierisi / na_nested.R
Created March 9, 2018 17:31
NAs in nested lists
# Problem description:
# I came across an error here when removing rows with NA values from a data.frame (a tibble actually)...the tibble has nested a
# tibble...does complete.cases not work with nested lists?
library(dplyr)
library(tidyr)
df = data.frame(a = 1:5, b = c(NA, 2:5), group = sample(x = c("A", "B", NA), prob = c(0.4, 0.3, 0.3), size = 5, replace = T))
df
df = df %>% nest(key = c(a, b))
df$group = as.character(df$group)
@kierisi
kierisi / code_to_fix_distro.R
Created January 13, 2018 17:10
fixing a Qualtrics email distribution error
# load required packages via tidyverse
library(tidyverse)
# here() used to write csv to correct folder - need to spend time sorting how to use it on file import
library(here)
# create a single file of our entire event email distribution (currently 10 separate files)
# import files from data folder and bind - know that all column headers are the same
# shamelessly stolen from stackoverflow
orig_contacts <-