Giter VIP home page Giter VIP logo

cepr's Introduction

Rob McDonnell

I'm a manager of a data science team.

Open-Source projects I've contributed to:

  • tidyRSS, an R package to get and parse RSS feeds
  • congressbr, an R package to parse Braziian legislative data. Also contains some utility functions for political science.

A couple of my toy projects:

  • Print an XKCD comic to the RStudio plot window with XKCDdata.
  • 🏉 rugger, and R package for rugby fans.

I also blog sometimes at www.robertmylesmcdonnell.com. My site is open-source, I developed it using Gatsby.js quarto, you can see the source here.

cepr's People

Contributors

danilofreire avatar edumucelli avatar giannottirod avatar robertmyles avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

cepr's Issues

Error in curl

Olá,
Utilizei o script de artigo que que utiliza a biblioteca cepR:

#cria um data frame temporário que será utilizado para ser preenchido durante as iterações relativas a cada CEP.
geo_coded<- data.frame(estado=character(),cidade=character
bairro=character(),cep=character(),logradouro=character(),latitude=character(),longitude=character(),altitude=character(),ddd=character(),cod_IBGE=character(),quality = logical(),cep_buscado = character(),stringsAsFactors=FALSE)
cep_unico <- as.character(unique(internacoes$CEP)) # cria um vetor com os CEPS sem repetição para minimizar a realização das consultas na API do CEP Aberto
#Loop de consulta de cada CEP listado no vetor: cep_unico
for (i in 1:10000) {
sys1 <- Sys.time()
consulta <-busca_cep(cep=(cep_unico[[i]]), token= ‘seu token’)
consulta$quality <- anyNA(c(consulta$latitude, consulta$longitude))
consulta$cep_buscado <- cep_unicos[[i]]
geo_coded <- rbind(geo_coded, consulta, make.row.names=FALSE)
if(Sys.time()-sys1 <=4.0) Sys.sleep(4.0-(Sys.time()-sys1))}

Consegui fazer consultas que foram muito úteis, mas na última semana a busca começa e depois ocorre o seguinte erro:

Error in curl::curl_fetch_memory(url, handle = handle) :
schannel: next InitializeSecurityContext failed: SEC_E_CERT_EXPIRED (0x80090328) - O certificado recebido expirou.

Você pode me ajudar?

Desde já agradeço.

busca_cidade errors

These are coming back sometimes from busca_cidade():

Error in max(sapply(this, list_depth)) : 
  invalid 'type' (list) of argument

Error in names(object) <- nm : 
  'names' attribute [2] must be the same length as the vector [1]

Erro nos comandos decorrente a atualização de dependencias

Os comandos do pacote estavam funcionando normalmente até eu atualizar o pacote "purrr", a partir desse momento começaram a apresentar o seguinte erro:

sp <- cepR::busca_cidades(estado = "SP", token = token)
Error in map_chr():
! In index: 1.
! With name: node.
Caused by error in pluck_raw():
! Can't pluck from a pointer at level 1.

rlang::last_trace()
<error/purrr_error_indexed>
Error in map_chr():
! In index: 1.
! With name: node.
Caused by error in pluck_raw():
! Can't pluck from a pointer at level 1.


Backtrace:

  1. ├─cepR::busca_cidades(estado = "SP", token = token)
  2. │ └─tibble::tibble(...)
  3. │ └─tibble:::tibble_quos(xs, .rows, .name_repair)
  4. │ └─rlang::eval_tidy(xs[[j]], mask)
  5. └─purrr::map_chr(...)
  6. └─purrr:::map_("character", .x, .f, ..., .progress = .progress)
  7. ├─purrr:::with_indexed_errors(...)
    
  8. │ └─base::withCallingHandlers(...)
    
  9. ├─purrr:::call_with_cleanup(...)
    
  10. └─cepR (local) .f(.x[[i]], ...)
    
  11.   └─purrr::pluck(.x, "nome", .default = NA_character_)
    
  12.     └─purrr:::pluck_raw(.x, list2(...), .default = .default)
    

Nos demais comandos não apresenta erro, apenas devolve a tabela com valores vazios:

cepR::busca_multi(lista_ceps = "81540000", token = token)

A tibble: 1 × 10

estado cidade bairro cep logradouro latitude longitude altitude ddd cod_IBGE

1 NA NA NA NA NA NA NA NA NA NA

Error: "Error: Can't pluck from a externalptr"

While running the code below:

library(cepR)
token = "XXXXXXXXXXXXX"
Est_MA <- busca_estado(estado = "MA", token = token)

I get the following error:

Error: Can't pluck from a externalptr

Erros nos comandos do pacote

Olá pessoal, tudo bem?

Estou tentando usar o pacote seguindo os comandos do readme, para testar.

Mas nenhum funciona.

Abaixo deixei uma lista dos comandos que tentei usar. Poderiam me dizer se há algum problema com o pacote, por favor?

Obrigada desde já!

Comando data("sp") retorna: In data("sp") : data set ‘sp’ not found

Comando sp <- busca_estado(estado = "SP", token = token) retorna: Error in busca_estado(estado = "SP", token = token) : precisa 'cidade'

Aí incluí a cidade (tentei São Paulo com e sem acento), mas o resultado é um df com todas as colunas e uma linha, mas só com NAs.

No comando busca_cep(token = token), obtenho o seguinte erro:
Error in paste0(base_url, "cep?cep=", cep) : object 'base_url' not found
Called from: paste0(base_url, "cep?cep=", cep)

Se eu coloco algum cep na busca, o erro volta igual.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.