Code Monkey home page Code Monkey logo

r2country's Introduction

r2country: Compiled dataset and functions for country names, capitals, languages and so on.

@@ Quick calls to obtain various country info for use in writing R markdown and developing robust applications @@

! Please NOTE that currently the 'timeIn' call may not provide 100% accurate result for time in particular places. This aspect is being worked on for the next version, so don't fret ! 


Install

remotes::install_github("oobianom/r2country")

#or from CRAN

install.packages("r2country") 


Use

Get all countries

#load package
library(r2country)

#get countries
countries

#or
#get countries in uppercase
COUNTRIES

Load datasets

data(country_calling_code) # calling code for countries
data(country_population) # population by year for countries
data(city_time) # time by city
data(country_names) # country names
data(country_money) # countries currency
data(country_language) # country language
data(country_capital) #country capitals
data(country_continent)# continent countries

Use functions available

Few examples

#get capital of a country

capitalOf$nigeria #for nigeria
capitalOf$china #for china
capitalOf[c("slovenia","romania","malaysia")] #get multiple capitals

#get offical languages of a country

languageOf$romania #for romania
languageOf$mexico #for mexico
languageOf[c("egypt","united kingdom","taiwan")] #get multiple languages

#get population count of country

populationOf$india #for india
populationOf$brazil #for brazil
populationOf[c("slovenia","ghana","nigeria")] #get multiple countries


#get the current time in a place

grep("usa,",names(timeIn), value = T) #get the available USA regions
timeIn$`usa, california, oakland` #get the current time in Oakland, California

grep("nigeria,",names(timeIn), value = T) #get the available Nigeria regions
timeIn$`nigeria, lagos, lagos` #get the current time in Lagos, Nigeria

# And others...

Get more examples

๐Ÿ”ด For complete list, go to official website above

r2country's People

Contributors

oobianom avatar

Stargazers

 avatar

Watchers

 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.