My data is in a format, that looks like this:
t2 <- "a = 10\n b = 2\n c =20\n"
How can I parse it so that I get a dataframe that looks like this?
# a 10
# b 2
# c 20
I'm trying to use readr::format_delim()
, but I'm happy to use any solution. The code below doesn't give me the right answer.
library(readr)
t2 <- as_tibble(t2)
format_delim(t2, delim = "\n")