Learn R Programming

repijson (version 0.1.0)

epijsonObjectVis: to view the structure of epijson objects and/or schema allowing multiple attribute boxes with different labels

Description

to view the structure of epijson objects and/or schema allowing multiple attribute boxes with different labels

Usage

epijsonObjectVis(attribMeta = "attributes [name, type, value, units]", attribRecord = "attributes [name, type, value, units]", attribEvent = "attributes [name, type, value, units]", labelObject = "Diagram of EpiJSON file structure", labelMeta = "metadata", labelRecord = "records [id]", labelEvent = "events [id, name, date, location]", colAll = NULL, colObject = "gray60", colMeta = "gray60", colRecord = "blue", colEvent = "red", colAttrib = "purple", textSize = 4)

Arguments

attribMeta
label(s) for Metadata attributes
attribRecord
label(s) for Record attributes
attribEvent
label(s) for Event attributes
labelObject
label for the overall object
labelMeta
label for Metadata attributes
labelRecord
label for Record attributes
labelEvent
label for Event attributes
colAll
optional single box colour to overide all other col args, e.g. 'grey'
colObject
object box colour
colMeta
metadata box colour
colRecord
record box colour
colEvent
event box colour
colAttrib
attribute boxes colour
textSize
size of labels default=4

Value

a ggplot object

Examples

Run this code
#this gives the base schema
epijsonObjectVis()
#settin single box colour and increasing text size
epijsonObjectVis(colAll ='grey', textSize=7)
#this gives a diagram with named attributes
epijsonObjectVis( attribMeta = c("attribute: disease","attribute: data provider"),
                   attribRecord = c("attribute: gender","attribute: date of birth"),
                   attribEvent = c("attribute: recorder","attribute: test used") )
epijsonObjectVis( attribMeta = c("a"),
                   attribRecord = c("b","c"),
                   attribEvent = c("d","e","f") )
#repijson objects
epijsonObjectVis( attribMeta = 'ejAttribute',
                  attribRecord = 'ejAttribute',
                  attribEvent = 'ejAttribute',
                  labelObject = 'ejObject',
                  labelMeta = 'ejMetadata',
                  labelRecord = 'ejRecord',
                  labelEvent = 'ejEvent')
#repijson objects and constructors
epijsonObjectVis( attribMeta = 'ejAttribute create_ejAttribute()',
                   attribRecord = 'ejAttribute create_ejAttribute()',
                   attribEvent = 'ejAttribute create_ejAttribute()',
                   labelObject = 'repijson R objects and constructors : ejObject create_ejObject()',
                   labelMeta = 'ejMetadata create_ejMetadata()',
                   labelRecord = 'ejRecord create_ejRecord()',
                   labelEvent = 'ejEvent create_ejEvent()')

Run the code above in your browser using DataLab