Goal
I have a few text thousand files I am reading through with purrr::pmap() and trying to turn them into dataframes. I am struggling to separate the columns based on white space. Any and all help is greatly appreciated. Here is a small example of what I am working with and my attempts thus far.
REPREX
library(tidyr)
library(dplyr)
data <- c(" 0 DAG 1 31 93.59",
" 1 DAG 1 31 107.7",
"31 DAG 0 1 39.00",
" 0 SRH 1 31 90.38",
" 1 SRH 1 31 100.0",
"31 SRH 0 1 29.00",
" 0 PECS 1 31 79.54",
" 1 PECS 1 31 84.27",
"31 PECS 0 1 28.00")
data %>%
as_tibble() %>%
separate(col = c("type", "station", "hour", "minute", "sec"))