I\'m still relatively new to R and hope you can again help me. I have a character vector with a length of 42000. The vector looks like this:
a <- c(\"blab
I know I'm late to this party, but I wanted to see this same idea in a magrittr pipe and using more tidyverse functions. Here's what I've got:
library(stringr)
library(lubridate)
library(tidyverse)
a <- c("blablabla-19960101T000000Z-1.tsv", "blablabla-19960101T000000Z-2.tsv", "blablabla-19960101T000000Z-3.tsv")
a %>%
strsplit('-') %>%
transpose() %>%
map_dfc(~data_frame(.x)) %>%
unnest() %>%
set_names(c('Name','Date','no')) %>%
mutate(Date = Date %>%
str_extract('\\d+') %>%
ymd(),
no = str_extract(no, '\\d+'))