diff options
Diffstat (limited to 'man/cep_lookup.Rd')
| -rw-r--r-- | man/cep_lookup.Rd | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/man/cep_lookup.Rd b/man/cep_lookup.Rd new file mode 100644 index 0000000..3c22a1e --- /dev/null +++ b/man/cep_lookup.Rd @@ -0,0 +1,46 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/api.R +\name{cep_lookup} +\alias{cep_lookup} +\title{Look up a single CEP} +\usage{ +cep_lookup(cep, client = default_client()) +} +\arguments{ +\item{cep}{A length-one character vector: \code{"01001-000"} or \code{"01001000"}.} + +\item{client}{A \code{\link[=cepis_client]{cepis_client()}}. Defaults to a shared client built with +the default configuration.} +} +\value{ +A \link{cepis_address}. +} +\description{ +Accepts the CEP masked or unmasked and returns everything the DNE database +has for it, including the coordinate when there is one. +} +\section{Conditions}{ + +\describe{ +\item{\code{cepis_invalid_cep}}{the CEP is not 8 digits. No request is made.} +\item{\code{cepis_not_found}}{well-formed, but not in the database.} +\item{\code{cepis_rate_limited}}{429 on every attempt.} +\item{\code{cepis_server_error}}{5xx on every attempt.} +\item{\code{cepis_network_error}}{the request never completed.} +\item{\code{cepis_invalid_response}}{a success status with an unreadable +body.} +} + +All of them inherit \code{cepis_error}; see \link{cepis_conditions}. +} + +\examples{ +\donttest{ +address <- cep_lookup("01001-000") +address$localidade +if (!is.null(address$geo) && address$geo$is_precise) { + c(address$geo$lat, address$geo$lon) +} +} + +} |