I asked this on stackoverflow and I got an alternative solution, but I'm interested in understanding why str_c and str_remove_all aren't behaving the way I thought they would/giving a regex error.
Output: "Sepal.Length","Sepal.Width","Petal.Length","Petal.Width" It gets me close to what I want (I don't really care about the space missing after the comma) but I can't remove the backslash afterwards with str_remove_all because it doesn't recognize the escaped backslash
This gives you a quotation-wrapped, comma-separated vector. As mentioned on SO, the slashes you see in your R console are not in the vector itself, they only show in your console as escape characters for the quotation marks.