This is not very informative, other than the underlying logic failed
data2 <- c(
'Order/ID : IN-2013-77878',
'Order/Date : 2/5/13',
'Ship/Mode: Second Class',
'product/id : TEC-AC-10003033',
' ',
'Order/ID : IN-2013-77878',
'Order/Date : 2/8/13',
'Ship/Mode: Second Class',
'product/id : FUR-CH-10004050'
)
> data <- tibble::enframe(data2) %>%
+ select(value) %>%
+ filter(., str_detect(value,':')) %>%
+ separate(., value, into = c('var','val')) # use tidyr's seperate to split data
Warning message:
Too many values at 8 locations: 1, 2, 3, 4, 5, 6, 7, 8
It fails due to no sep argument, so maybe outputting an error message stating "Hey are you missing a separator argument?)
This works:
data <- tibble::enframe(data2) %>%
select(value) %>%
filter(., str_detect(value,':')) %>%
separate(., value, into = c('var','val'), sep = ':')
This is not very informative, other than the underlying logic failed
It fails due to no sep argument, so maybe outputting an error message stating "Hey are you missing a separator argument?)
This works: