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
  • 154,425
  • 26
  • 353
  • 447
user5516342
  • 405
  • 1
  • 6
  • 10

1 Answers1

11

By using `` as in

df$`Avg Estimates`         
Julius Vainora
  • 45,908
  • 9
  • 86
  • 100
  • 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