I have a csv with 2 columns but should be 7. The first column is a numerical ID. The second column has the other six numerical values. However, there are several different delimiters between them. They all follow the same pattern: numerical value, a dash ("-) OR a colon (":"), eight spaces, and then the next numerical value, until the final numerical value, with nothing after it. It starts with a dash and alternates with a colon. For example:
28.3- 7.1: 62.3- 1.8: 0.5- 196
Some of these cells have missing values denoted by a single period ("."). Example:
24- .: 58.2- .: .- 174
I'm using R but I can't figure out how to accomplish this. I know it probably requires dplyr or tidyverse but I can't find what to do where there are different delimiters and spaces.
So far, I've only successfully loaded the csv and used "str()" to determine that the column with these six values is a factor.
Here is how the data look in the .csv:
Here is how it looks in RStudio after I read it in using read.csv
Here is how it looks in RStudio if I use tab as the delimiter when using read.csv, as suggested in the comments