locale: Create a locale

Description Usage Arguments See Also Examples

View source: R/locale.R

Description

This locale object acts much like the locale object from the readr package. It is used to provide direction to the formatting methods for classes of each individual memeber of the query-parameter list sent to serialize_list.

Usage

1
2
3
4
locale(logical_format = list(true = "true", false = "false"),
  dtime_format = c("ms", "s", "minute", "hour", "day", "week"))

default_locale()

Arguments

logical_format

list, with two members: true and false, character strings indicating how logicals are written.

dtime_format

character, indicating how to express time-differences. Using serialize_list, time-differences are indicated by using difftime, lubridate::duration, or lubridate::period. The options indicate which time unit to use, "ms" being the default. The output for time-differences is a character representation of the numeric value of the time-differences expressed using that unit.

See Also

serialize_list

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
library("lubridate")

query_params <- list(
  keep = TRUE,
  delay = dseconds(5)
)

serialize_list(query_params)

locale_new <- locale(
  logical_format = list(true = "True", false = "False"),
  dtime_format = "s"
)

serialize_list(query_params, locale = locale_new)

ijlyttle/srlze documentation built on May 18, 2019, 3:42 a.m.