Giter VIP home page Giter VIP logo

ubigeosperu's Introduction

ubigeosperu

Project Status CRAN status

The goal of ubigeosperu is to have an easy way to get the peruvian ubigeos into R. The data has been collected from CONCYTEC’s GitHub repository.

Installation

You can install the released version of ubigeosperu from CRAN with:

## This will work when the package is published into CRAN
install.packages("ubigeosperu")

And the development version from GitHub with:

# install.packages("devtools")
devtools::install_github("calderonsamuel/ubigeosperu")

Example

This is a basic example which shows you how to solve a common problem:

library(ubigeosperu)
library(dplyr)

ubigeosperu contains a single dataframe object containing the peruvian ubigeos codes.

dim(ubigeos)
#> [1] 1876   18

The ubigeos dataset is a tibble.

ubigeos
#> # A tibble: 1,876 x 18
#>    cod_dep_inei desc_dep_inei cod_prov_inei desc_prov_inei cod_ubigeo_inei
#>    <chr>        <chr>         <chr>         <chr>          <chr>          
#>  1 01           AMAZONAS      0101          CHACHAPOYAS    010101         
#>  2 01           AMAZONAS      0101          CHACHAPOYAS    010102         
#>  3 01           AMAZONAS      0101          CHACHAPOYAS    010103         
#>  4 01           AMAZONAS      0101          CHACHAPOYAS    010104         
#>  5 01           AMAZONAS      0101          CHACHAPOYAS    010105         
#>  6 01           AMAZONAS      0101          CHACHAPOYAS    010106         
#>  7 01           AMAZONAS      0101          CHACHAPOYAS    010107         
#>  8 01           AMAZONAS      0101          CHACHAPOYAS    010108         
#>  9 01           AMAZONAS      0101          CHACHAPOYAS    010109         
#> 10 01           AMAZONAS      0101          CHACHAPOYAS    010110         
#> # … with 1,866 more rows, and 13 more variables: desc_ubigeo_inei <chr>,
#> #   cod_dep_reniec <chr>, desc_dep_reniec <chr>, cod_prov_reniec <chr>,
#> #   desc_prov_reniec <chr>, cod_ubigeo_reniec <chr>, desc_ubigeo_reniec <chr>,
#> #   cod_dep_sunat <chr>, desc_dep_sunat <chr>, cod_prov_sunat <chr>,
#> #   desc_prov_sunat <chr>, cod_ubigeo_sunat <chr>, desc_ubigeo_sunat <chr>

You can access the tidy version and pipe it!

ubigeos_tidy %>%
    filter(lugar == "CHORRILLOS", nivel == "Distrito")
#> # A tibble: 3 x 4
#>   lugar      nivel    entidad ubigeo
#>   <chr>      <chr>    <chr>   <chr> 
#> 1 CHORRILLOS Distrito INEI    150108
#> 2 CHORRILLOS Distrito RENIEC  140108
#> 3 CHORRILLOS Distrito SUNAT   150108

ubigeosperu's People

Contributors

calderonsamuel avatar

Stargazers

 avatar

Watchers

 avatar  avatar

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.