characterAttribute <- create_ejAttribute(name="Format name", type="string",
value="EpiJSON!")
numericAttribute <- create_ejAttribute(name="Width of building", type="number",
value=5.2,"metres")
integerAttribute <- create_ejAttribute(name="Days since last accident", type="integer",
value=as.integer(2))
logicalAttribute <- create_ejAttribute(name="Customer satisfied", type="boolean",
value=TRUE)
dateAttributeOne <- create_ejAttribute(name="Birthdate", type="date",
value=as.Date("1998-08-21"))
dateAttributeTwo <- create_ejAttribute(name="Lunch", type="date",
value=as.POSIXct("2015-05-06 12:30"))
if (require(base64enc, quietly=TRUE)){
binaryAttribute <- create_ejAttribute(name="Lunch", type="base64",
value=base64encode(as.raw(0:255)))
}
Run the code above in your browser using DataLab