ocbc_locator: Make requests to the OCBC Locator category APIs

Description Usage Arguments Value Examples

View source: R/Locators.R

Description

This function makes the information from the OCBC Locators category APIs easily accessible in an R-readable format. It also produces an interactive map of the ATMs and their locations There are 3 different types of locators, each with their own unique API
1. ATMs
2. OCBC Branches and Centres
3. Deposit Machines and Safe Deposit Boxes

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
ocbc_locator(
  locator_type = c("ATM", "Branch", "Deposit"),
  acctoken,
  category = NULL,
  country = NULL,
  landmark = NULL,
  latitude = NULL,
  longitude = NULL,
  radius = NULL
)

Arguments

locator_type

Locator type, hence the API that the function will call from. Required. Options are "ATM" for ATMs, "Branch" for Branches and Centres, "Deposit" for Deposit Machines and Safe Deposit Boxes. Note: it is recommended to only specify 1 locator type at a time.

acctoken

Account token. Required. Users can sign up for their api key, api secret and account token at https://api.ocbc.com/store/home

category

filter locators by category. Optional.

For ATMs (locator_type = "ATM") options are:
'1' for ATMs
'2' for Fastlanes '3' for Passbook update machines

For OCBC Branches and Centres (locator_type = "Branch") options are:
'1' for Al-Amin Bank Branch
'2' for Bank Branch
'3' for Business Centre
'4' for Frank Store (Note: API content currently unavailable)
'5' for Premier Centre (Note: API content currently unavailable)
'6' for Sunday Branch (Note: API content currently unavailable)
'7' for Trade Centre (Note: API content currently unavailable)

For Deposit Machines and Safe Deposit Boxes (locator_type = "Deposit") options are:
'1' for Cash Deposit Machines
'2' for Quick Cheque Deposit
'3' for Safe Deposit

country

Filter locators by country. Optional. Options are 'SG' for Singapore and 'MY' for Malaysia

landmark

Filter locators by local landmark. Optional. E.g 'Esplanade', '7-Eleven', 'park'

latitude

Filter locators by latitude. Optional. (Requires longitutde and radius to filter for nearest locator)

longitude

Filter locators by longtitude. Optional. (Requires latitude and radius to filter for nearest locator)

radius

Filter locators by radius. Optional. (Requires longtitude and latitude to filter for nearest locator)

Value

Returns a list containing 2 items.
1. The first is a detailed dataframe with variables of key information about the locators (e.g the category of the locator, the address of the locator, landmark where the locator is located, geological latitude and longitude of the locator, postal code, remarks and disclaimers).
2.The second is an interactive map indicating the locations of the locators featured in the dataframe. Each point on the map correponds to a row in the above dataframe, users can click on each point to reveal a summary information table about the locator.

Examples

1
2
ocbc_locator(locator_type = "ATM", acctoken = Sys.getenv("ACC_TOKEN_OCBC"),
category = 1, country = "SG")

racheltlw/OCBCR documentation built on Dec. 16, 2019, 12:46 a.m.