Problem:
I am (trying to) construct a data.frame
in R, where the column name sometimes includes punctuation characters such as "?".
However, R converts these into "." , for instance:
Code
t= data.frame("a?a" = c(1,2,3), "bee" = c(200,300,400))
t= data.frame("a.a" = c(1,2,3), "bee" = c(200,300,400))
both return
t
a.a bee
1 1 200
2 2 300
3 3 400
I couldn't get escaping to work either (and would like to avoid it, as I have plenty of strings without special characters).
t= data.frame("a\\?a" = c(1,2,3), "bee" = c(200,300,400))
> t
a..a bee
1 1 200
2 2 300
3 3 400
Question:
I would like to have characters such as question marks and dots represented in my column names (columns contain results for regular expression searches); in the least, they should be kept distinct.
- Is there any way to do so?
I felt like this might haven been brought up before but could not find it on here; grateful for any pointers. Thanks!