Reputation: 25
I have a data frame that was scraped from a webpage. Some of the column headers have hyphens in them (for example, ERA-), and it does not seem like dplyr allows me to deal with them.
I am trying to do this:
dataframe_new <- dataframe_old %>%
transmute(ERA_minus = ERA-)
but I keep getting Error: unexpected ')' in:
I'm pretty new to R, so what's the best way to deal with something like this?
Upvotes: 1
Views: 53
Reputation: 887213
We could use backquotes for those columns
library(dplyr)
dataframe_old %>%
transmute(ERA_minus = `ERA-`)
Upvotes: 1