Mehrad :kde: :emacs: :rstats: on Nostr: I had a small #RStats dilemma and the answer really surprised me. I have bunch of CSV ...
I had a small #RStats dilemma and the answer really surprised me.
I have bunch of CSV files and some are messy and need to be cleaned up, so I cannot use `read.csv()` or readr::read_csv()` as they throw errors. So I read the files as text files (`readLines()`), do the cleaning with regex and etc. and ultimately I want to convert them to data.frame.
The dilemma was how to convert it to DF. Initial thought was `splitstr()` and then `Reduce()`, but I did some digging:
I have bunch of CSV files and some are messy and need to be cleaned up, so I cannot use `read.csv()` or readr::read_csv()` as they throw errors. So I read the files as text files (`readLines()`), do the cleaning with regex and etc. and ultimately I want to convert them to data.frame.
The dilemma was how to convert it to DF. Initial thought was `splitstr()` and then `Reduce()`, but I did some digging:

