initiate_project: Initiate Project

initiate_projectR Documentation

Initiate Project

Description

Select the country or city, get the ISO 3166-1 alpha-3 country code, store it in a config.txt file and create the directory main structure for the project. This function also creates a log.txt file that will record and track the main operations related to the project.

Usage

initiate_project(
  mainPath,
  allowInteractivity = TRUE,
  city = FALSE,
  name = NULL,
  iso = NULL,
  testMode = FALSE
)

Arguments

mainPath

character; a path where the country/city folder will be created

allowInteractivity

logical; whether to enable interactivity. TRUE by default.

city

logical; whether to focus on cities instead of countries. FALSE by default.

name

character; country or city name required when allowInteractivity is set to FALSE. Must match perfectly either one of the names included in inAccessMod::country_list (country) or inAccessMod::city_list (city). For cities, can also be the name of the city combined with the country ISO2 code when > 1 city have the same name (ex. 'Vancouver'). In this case the format is the following: city name, white space, hyphen, space, code (ex. 'Zurich - CH'). This parameter is ignored when allowInteractivity is set to TRUE.

iso

character; optional and only when city is TRUE, the ISO 3166-1 alpha-3 country code. The ESRI World Urban Areas dataset may have inaccurate country information for cities situated near borders, and this parameter allows the user to set up the country in which is located the city. Using an incorrect code for downloading the population raster can result in either an issue or obtaining the wrong population dataset.

testMode

logical; FALSE by default. Can be ignored. used for testing the function in the testthat context.

Details

The final structure arises when downloading and processing the data with the corresponding functions, and it allows multiple 'raw' inputs and multiple 'processed' outputs for each input. This can be useful when performing different analyses for the same country (e.g. when we have updated data).

Examples

# Replace workDir with the actual path to your working directory
## Not run: 
mainPath <- "workDir"
initiate_project(mainPath)
## End(Not run)

ptimoner/inAccMod documentation built on Jan. 27, 2025, 9:34 a.m.