create_ejAttribute: Create an attribute This package outlines the aspects of the...

Description Usage Arguments Value Examples

View source: R/constructors.R

Description

This function defines attributes output ejAttribute

Usage

1

Arguments

name

name of the attribute

type

type of data 'string', 'number', 'integer', 'boolean', 'date' or 'base64'

value

value of this attribute

units

The units for value. May be omitted.

Value

an ejAttribute object

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
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)))
}

repijson documentation built on May 29, 2017, 2:12 p.m.

Search within the repijson package
Search all R packages, documentation and source code