2

I have a CSV file that I want to analyze in R. One of the variable names is Team/NOC. When I try to filter this variable I get an error message (probably because of the forward slash in the variable name).

  • My code:
filter(Medals,Team/NOC=="Japan")
  • The error message:

Error: Problem with filter() input ..1. i Input ..1 is Team/NOC == "Japan". x object 'Team' not found

So, how can I solve this problem please?

lovalery
  • 4,524
  • 3
  • 14
  • 28
  • 4
    Use backticks around the normally not-legal variable name: `filter(Medals, \`Team/NOC\` == "Japan")` – r2evans Oct 15 '21 at 14:56

0 Answers0