getTMax: Get CHIRTSmonthly data for a specified country and time...

View source: R/functions.R

getTMaxR Documentation

Get CHIRTSmonthly data for a specified country and time period

Description

getTmax() takes DHS spatial point data from the jgnutritionsecurity database and reads geotiff data from an HTTP web protocol to calculate monthly temperature values at each point of interest.

Usage

getTMax(conn, countryCode, Year, startDate, endDate)

Arguments

conn

a Formal class MySQLConnection established with 'RMySQL'

countryCode

a 3 digit character vector representing the country where spatial points should be extracted from. This is the 'COUNTRY' column in the countries table in the jgnutritionsecurity database. Run getCountryYearCom to find unique country and year combinations.

Year

a 4 digit character vector representing the Year the survey was conducted.

startDate, endDate

YYYY-MM-DD for start date and end date.

Value

A data frame with monthly CHIRTSmax values in Celsius for each spatial observation. Additional attributes for spatial observations will be preserved. See CHIRTS website for more information. https://www.chc.ucsb.edu/data/chirtsmonthly

Examples

getTMax(conn = mydb,
 countryCode = "024",
  Year = "2015",
   startDate = "2014-01-01",
   endDate = "2016-12-31")

Will return monthly CHIRTSmax data for all DHS points in
Angola from 01-01-2014 to 12-31-2016


MacDonaldMichael1/jgNutritionTools documentation built on Sept. 17, 2022, 6:39 a.m.