Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Trouble selecting variables #28

Closed
baarthur opened this issue May 15, 2023 · 1 comment
Closed

Trouble selecting variables #28

baarthur opened this issue May 15, 2023 · 1 comment

Comments

@baarthur
Copy link

baarthur commented May 15, 2023

Hi there,

First of all, thanks for the great work on this package! I am not sure if this is a bug or more of a feature request, but here it goes:

When selecting variables in read_flights(), I can't select columns "sg_equipamento_icao" and "ds_matricula", which are available on Anac's data according to the link in the function's manual. I think there may be a bug while fetching those columns... Or they aren't available in the package's dataset?

In addition: it would be great if we could pass a vector of dates in the function!

Here's my code:

df_flights <- read_flights(
  202303, 
  type = "combinada", 
  select = c(
    "id_combinada", 
    "sg_empresa_icao", "nr_voo", "dt_referencia", 
    "sg_icao_origem", "sg_icao_destino", 
    "ds_natureza_etapa", "nr_etapa", "cd_di", "ds_di", 
    "dt_partida_real", "dt_chegada_real", 
    "sg_equipamento_icao", "ds_matricula", # these two throw a warning message
    "nr_passag_pagos", "nr_passag_gratis", 
    "kg_bagagem_livre", "kg_bagagem_excesso", "kg_carga_paga", "kg_carga_gratis", "kg_correio"
  )
) %>% 
  mutate(
    across(
      nr_passag_pagos:kg_correio,
      as.numeric
    )
  )
@baarthur baarthur changed the title Trouble filtering variables Trouble selecting variables May 15, 2023
@rafapereirabr
Copy link
Member

For some reason, the columns sg_equipamento_icao and ds_matricula are present in the "basica data set data (type = "basica") but not in the "combinada" data set. I don't know why, but this is something in the original ANAC data, so there's nothing we can do on our side unfortunately.

Regarding your suggestion, that's a very good suggestion. I've opened a We should probably open a separate for it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants