types.castInteger: Cast integer

View source: R/types.castInteger.R

types.castIntegerR Documentation

Cast integer

Description

Cast integer. Integer values are indicated in the standard way for any valid integer.

Usage

types.castInteger(
  format,
  value,
  options = {
 }
)

Arguments

format

no options (other than the default)

value

integer to cast

options

named list set bareNumber TRUE or FALSE, see details

Details

bareNumber is a boolean field with a default of TRUE. If TRUE the physical contents of this field must follow the formatting constraints already set out. If FALSE the contents of this field may contain leading and or trailing non-numeric characters (which implementors MUST therefore strip). The purpose of bareNumber is to allow publishers to publish numeric data that contains trailing characters such as percentages e.g. 95 if anything, they do with stripped text.

See Also

Types and formats specifications

Examples

types.castInteger(format = "default", value = 1)

types.castInteger(format = "default", value = "1")
# cast trailing non numeric character
types.castInteger(format = "default", value = "1$", options = list(bareNumber = FALSE))


frictionlessdata/tableschema-r documentation built on Oct. 1, 2022, 11:44 a.m.