parseEvidence | R Documentation |
The as.json
function takes an
EvidenceSet
(among other objects) and turns it
into JSON. The function parseEvidence
takes the list produced
as the output to fromJSON
and turns it back
into an EvidenceSet
object.
parseEvidence(rec)
## S4 method for signature 'EvidenceSet,list'
as.jlist(obj, ml, serialize=TRUE)
rec |
A list which comes from running
|
obj |
The object being serialized; usually |
ml |
A list of fields of the object. |
serialize |
A logical flag. If true,
|
See the description for as.json
for more
description of the JSON conversion prototocl.
The parseEvidence
method is designed to be used with the
getOneRec
and getManyRecs
functions for fetching information from the database.
The function parseEvidence
returns an object of class
EvidenceSet
.
The as.jlist
method returns a list which can be passed to
toJSON
to produce legible JSON from the R
object.
Russell Almond
EvidenceSet
, as.json
,
getOneRec
, getManyRecs
e1 <- EvidenceSet(uid="S1",app="Test",context="PPcompEM",
obs=list("CompensatoryObs"="Right"))
e2 <- EvidenceSet(uid="S1",app="Test",context="PPdurAttEM",
obs=list("Attempts"=2,"Duration"=38.3))
e1.ser <- as.json(e1)
e1a <- parseEvidence(jsonlite::fromJSON(e1.ser))
e2.ser <- as.json(e2)
e2a <- parseEvidence(jsonlite::fromJSON(e2.ser))
stopifnot(all.equal(e1,e1a), all.equal(e2,e2a))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.