3

As mentioned in the title, I would like to select a column with name "Avg Estimates" in a dataframe. How can I do this by using "$" operator? Thank you!

Josh O'Brien
  • 159,210
  • 26
  • 366
  • 455
user5516342
  • 435
  • 1
  • 6
  • 10

1 Answers1

11

By using `` as in

df$`Avg Estimates`         
Julius Vainora
  • 47,421
  • 9
  • 90
  • 102
  • 9
    In fact, backticks (\`), single quotes ('), and double quotes (") can all be used. Other options include `'$'(df, 'Avg Estimates')`, `df[['Avg Estimates']]`, and `'[['(df, 'Avg Estimates')`, and `get('Avg Estimates', df)` – Benjamin Jan 06 '16 at 20:34