Package 'openmarawi'

Title: An Interface to Open Marawi Database
Description: The citizens of Marawi have a right to the data and maps about their home city. When problems are complex, helping people find useful maps (access) can aid them both in finding themselves in the map (understanding) and making the map by themselves (ownership). Open data and useful maps can help empower citizens in mapmaking, placemaking, and decision-making because it can help citizens and interested parties in understanding the issues spatially. It is practical in deliberating, deciding, and delivering the rehabilitation of Marawi City.
Authors: Ernest Guevarra [aut, cre]
Maintainer: Ernest Guevarra <[email protected]>
License: GPL (>= 3)
Version: 0.0.0.9000
Built: 2025-02-23 03:00:51 UTC
Source: https://github.com/panukatan/openmarawi

Help Index


Get Google Drive identifier given a search pattern

Description

Get Google Drive identifier given a search pattern

Usage

get_drive_id(pattern, drive_list)

Arguments

pattern

A pattern to search for

drive_list

A dribble (usually produced from one of the marawi_ls() functions) from which to search the pattern from.

Value

A Google Drive identifier

Examples

get_drive_id("ARMM", drive_list = marawi_ls())

Get ARMM Barangay level data masterlist from the Open Marawi Google Drive Database

Description

Get ARMM Barangay level data masterlist from the Open Marawi Google Drive Database

Usage

marawi_get_armm(
  dataset = c("metadata", "demographics", "bgyfacilities", "conflict")
)

marawi_get_armm_all(tabular = TRUE)

Arguments

dataset

A string value from either "metadata", "demographics", "bgyfacilities", or "conflict" specifying the masterlist data to retrieve. If not specified, will default to "metadata".

tabular

Logical. Should output be flattened into a single data.frame? Default is TRUE. If FALSE, output is a list of data.frames for each sheet in the masterlist Excel file.

Value

A tibble or a list of tibbles of the specified masterlist dataset available in the ARMM directory of the Open Marawi Database.

Author(s)

Ernest Guevarra

Examples

## Retrieve the metadata dataset of the ARMM directory in the Open Marawi
## database
marawi_get_armm(dataset = "metadata")
## Not run: marawi_get_armm_all()

Get Lanao del Sur Barangay level data masterlist from the Open Marawi Google Drive Database

Description

Get Lanao del Sur Barangay level data masterlist from the Open Marawi Google Drive Database

Usage

marawi_get_lanao(
  dataset = c("metadata", "demographics", "bgyfacilities", "estab", "modetranspo",
    "conflict", "privateschools", "health")
)

marawi_get_lanao_all(tabular = TRUE)

Arguments

dataset

A string value from either "metadata", "demographics", "facilities", "establishment", "mode_transport", "conflict", "private_schools", or "health" specifying the masterlist data to retrieve. If not specified, will default to "metadata".

tabular

Logical. Should output be flattened into a single data.frame? Default is TRUE. If FALSE, output is a list of data.frames for each sheet in the masterlist Excel file.

Value

A tibble or a list of tibbles of the specified masterlist dataset available in the Lanao del Sur directory of the Open Marawi Database.

Author(s)

Ernest Guevarra

Examples

## Retrieve the metadata dataset of the Lanao del Sur directory in the Open
## Marawi database
marawi_get_lanao(dataset = "metadata")
## Not run: marawi_get_lanao_all()

Get Marawi Barangay level data masterlist from the Open Marawi Google Drive Database

Description

Get Marawi Barangay level data masterlist from the Open Marawi Google Drive Database

Usage

marawi_get_marawi(
  dataset = c("metadata", "demographics", "movements", "culture", "housing",
    "facilities", "establishments", "modetranspo", "conflict", "publicschools",
    "privateschools", "health")
)

marawi_get_marawi_all(tabular = TRUE)

Arguments

dataset

A string value from either "metadata", "demographics", "movements", "culture", "housing", "facilities", "establishments", "modetranspo", "conflict", "publicschools", "privateschools", and "health" specifying the masterlist data to retrieve. If not specified, will default to "metadata".

tabular

Logical. Should output be flattened into a single data.frame? Default is TRUE. If FALSE, output is a list of data.frames for each sheet in the masterlist Excel file.

Value

A tibble or a list of tibbles of the specified masterlist dataset available in the Lanao del Sur directory of the Open Marawi Database.

Author(s)

Ernest Guevarra

Examples

## Retrieve the metadata dataset of the Lanao del Sur directory in the Open
## Marawi database
marawi_get_marawi(dataset = "metadata")
## Not run: marawi_get_marawi_all()

List files and folders within the Open Marawi Google Drive database

Description

A convenience wrapper to googledrive functions set to specifically access the Open Marawi Google Drive database and list files and folders within.

Usage

marawi_ls(id = "1bph1LBRpxwydAvjuggyjmhmq6HhyteY8")

marawi_ls_armm(drive_list)

marawi_ls_lanao(drive_list)

marawi_ls_marawi(drive_list)

Arguments

id

Character vector of the Open Marawi Google Drive id. This is currently set to 1bph1LBRpxwydAvjuggyjmhmq6HhyteY8 which is the id of the Open Marawi Google Drive. Change this if Open Marawi Google Drive is moved.

drive_list

A dribble from which to search for required Google Drive directory.

Value

A dribble of names and ids of files and folders within the specified Google Drive

Author(s)

Ernest Guevarra

Examples

marawi_ls()
marawi_ls_armm(drive_list = marawi_ls())
marawi_ls_lanao(drive_list = marawi_ls())

Get maps data from Open Marawi Google Drive

Description

Get maps data from Open Marawi Google Drive

Usage

marawi_maps_get(dsn, layer = NULL)

Arguments

dsn

Data source name of map to retrieve. This should be one of the data source names listed in marawi_maps_list

layer

Layer name of map to retrieve. If NULL (default), all layers available within dsn will be retrieved.

Value

An sf object of specified map

Examples

##marawi_maps_get(dsn = "Hazards/Faultlines")

List of available map files in the Open Marawi Google Drive

Description

List of available map files in the Open Marawi Google Drive

Usage

marawi_maps_list

Format

A data frame with 4 columns and 391 rows:

Variable Description
dsn Data source name
layer Layer name
name Filename
id Google Drive identifier

Examples

marawi_maps_list

List Marawi maps

Description

List Marawi maps

Usage

marawi_maps_ls(id = "1Fj5sK2tKo0_v8EnEbN8m1pMfaSFADmYL")

Arguments

id

Character value of the Open Marawi Google Drive id for the Marawi geospatial directory. This is currently set to 1Fj5sK2tKo0_v8EnEbN8m1pMfaSFADmYL which is the id of the current id of the Open Marawi Google Drive for the Marawi geospatial directory. Change this if Open Marawi Google Drive is moved.

Value

A dribble of all the geospatial files for Marawi found in the Open Marawi Google Drive.

Examples

## Not run: 
  marawi_maps_ls()

## End(Not run)