0

I am trying to use select in R in this specific code chunk and it keeps giving the same message error:

Error: unexpected symbol in:
"stf_acervo_selecionada <- stf_acervo %>% select(Processo, Relator Atual"

This is the written code:

stf_acervo_selecionada <- stf_acervo %>% select(Processo, Relator Atual, Procedência)

Also, it describes that the unexpected token is the word "Atual".

Could anyone help me to understand this error?

Thank you

Ian Campbell
  • 23,484
  • 14
  • 36
  • 57
  • 1
    `dplyr` doesn't like variables that have spaces in their names. You need to wrap those in tick marks `stf_acervo %>% select(Processo, \`Relator Atual\`, Procedência)` – MrFlick Apr 18 '21 at 17:55

2 Answers2

0

Try:

stf_acervo_selecionada <- stf_acervo %>% select(Processo, `Relator Atual`, `Procedência`)

Notice the quotation around the two last variables.

As @MrFlick points out in the comment that definitely needs quoting, and is likely the real reason for your error. (As that last name may work just fine as it is without quoting, while a space in a name can never work.)

Sirius
  • 5,224
  • 2
  • 14
  • 21
0

Please consider to add a minimum working example. That will make it much easier for others to reproduce your error and find the problem. Here I guess it's the usage of ê. You should restrict yourself to UTF-8 characters only. It could also be the space in Relator Atual. You probably have to put that in backticks.

R. Schleutker
  • 131
  • 1
  • 4