Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Quickly filtering data for PTF
library(readr)
library(skimr)
library(dplyr)
library(stringr)
data <- readr::read_csv('data.csv')
skimr::skim(data)
data_cleaned <- data %>% filter(!stringr::str_detect(Page, "@powertofly\\.com")) %>%
mutate(Registrations =
case_when(stringr::str_detect(Page, "\\?show_confirmation") ~ 1, T ~ Registrations) )
write_csv(data_cleaned, "data_cleaned.csv")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment