Last active
June 27, 2020 21:56
-
-
Save necronet/6978e2b79b0d0eb299d629d788e2822b to your computer and use it in GitHub Desktop.
Quickly filtering data for PTF
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(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