Search code examples
rtibble

data.frame with unconventional column names


> data.frame(`(--fds` = 4)
  X...fds
1       4

Is there a way to get data.frame to have unconventional names like the above?

i.e.:

> tibble(`(--fds` = 4)
# A tibble: 1 × 1
  `(--fds`
     <dbl>
1        4

Solution

  • There's a check.names argument in data.frame, set it to FALSE.

    data.frame(`(--fds` = 4, check.names = F)
      (--fds
    1      4