Kelsey Kelsey - 9 months ago 51
R Question

How do I call a data frame in R that is titled a number?

I have a bunch of data frames that are titled 100, 102, 104...etc (after performing a split) but I can't seem to call them in R because they are numbers.

When I merge a data frame with these, I have tried putting "" and '' around them, etc. but then it only fills in the column with the number, not the data frame itself.

Any one know how to fix this issue?

Answer Source

You can protect identifiers with backticks:

R> `123` <- data.frame(a=1:3, b=letters[1:3])
R> `123`
  a b
1 1 a
2 2 b
3 3 c