Skip to content

Instantly share code, notes, and snippets.

View sebastian-c's full-sized avatar

Sebastian sebastian-c

View GitHub Profile
@sebastian-c
sebastian-c / readFAOData
Created January 13, 2023 12:54
Function to pull data from FENIX API in FAOSTAT
library(httr)
readFAOData <- function(area_codes, element_codes, item_codes, year_codes,
area_format = "M49",
item_format = "CPC",
dataset = "FBS",
metadata_cols = c("codes", "units", "flags", "notes"),
include_na = FALSE,
return_n_records_only = FALSE,
base_url = "https://fenixservices.fao.org/faostat/api/v1/en/data/"){
@sebastian-c
sebastian-c / DESCRIPTION
Last active December 15, 2015 06:49
Test package. Place myfunc.R in the R folder and roxygenise then build.
Package: pkg
Version: 0.5-1
Date: 2004-01-01
Title: My First Collection of Functions
Authors@R: c(person("Joe", "Developer", role = c("aut", "cre"),
email = "Joe.Developer@some.domain.net"),
person("Pat", "Developer", role = "aut"),
person("A.", "User", role = "ctb",
email = "A.User@whereever.net"))
Author: Joe Developer and Pat Developer, with contributions from A. User