Created
December 5, 2018 04:08
-
-
Save dylanjm/ef2fde50ee2fae94e0c7d7f255f24066 to your computer and use it in GitHub Desktop.
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(tidyverse) | |
read_lines(here::here("input_data/data04a.txt")) %>% | |
str_match("\\[(\\d+)-(\\d+-\\d+) (\\d+):(\\d+)\\] (.*$)") %>% | |
as_tibble() %>% | |
set_names(c("raw_data", "year", "date", "hour", "min", "comment")) %>% | |
mutate(id = str_extract_all(comment, "(\\d+)", simplify = T) %>% | |
ifelse(. == "", NA, .)) %>% | |
arrange(year, date, hour, min) %>% | |
fill(id) %>% | |
View() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment