Skip to content

Commit

Permalink
Adding description and example to read_od function
Browse files Browse the repository at this point in the history
  • Loading branch information
Haydée Svab committed Oct 7, 2023
1 parent c7615f6 commit 23d5203
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions R/read_od.R
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
#' Download microdata from OD Surveys databases
#'
#' @description
#' The "read_od" function requires as parameter city, year and whether you want the harmonized database (over the years, for the same city) or not - the default is the raw base
#' The "read_od" function requires as parameter city, year and whether you want
#' the harmonized database (over the years, for the same city) or not - the
#' default is the raw base.
#'
#' @template city
#' @template year
Expand All @@ -12,8 +14,14 @@
#' @family Microdata
#'
#' @examples
#' library(odbr)
#'
#'
#' # return data origin destination database as data.frame
#' df <- read_od(
#' city = "São Paulo",
#' year = 1977,
#' harmonize = FALSE
#' )
#'
read_od <- function(city = "São Paulo",
year = 1977,
Expand Down Expand Up @@ -47,7 +55,8 @@ read_od <- function(city = "São Paulo",

# Uploading the file to a release in odbr repository
od_file <- data.table::fread(temporary_filename,
sep = ";")
sep = ";"
)

# Delivering the requested file as a function return
return(od_file)
Expand Down

0 comments on commit 23d5203

Please sign in to comment.