TestRefEntries | R Documentation |
A class for accessing the test reference entries.
A class for accessing the test reference entries.
The test reference entries are stored as JSON files inside
inst/testref
folder of each extension package.
new()
New instance initializer.
TestRefEntries$new(db.class, pkgName, folder = NULL, bdb = NULL)
db.class
Identifier of the database.
pkgName
Name of the package in which are stored the reference entry files.
folder
The folder where to find test reference files for the package. Usually it is "inst/testref".
bdb
A valid BiodbMain instance or NULL.
Nothing.
getAllIds()
Retrieve all identifiers.
TestRefEntries$getAllIds(limit = 0)
limit
The maximum number of identifiers to return.
A character vector containing the IDs.
getContents()
Get the reference contents for the specfied IDs.
TestRefEntries$getContents(ids)
ids
The reference IDs for which to get the contents.
A character vector.
getRealEntries()
Retrieve all real entries from database corresponding to the reference entris.
TestRefEntries$getRealEntries(ids = NULL)
ids
A character vector of entry identifiers.
A list containing BiodbEntry instances.
saveEntriesAsJson()
Saves a list of entries into separate JSON files, inside the test output folder.
TestRefEntries$saveEntriesAsJson(ids, entries)
ids
The IDs of the entries.
entries
A list of entries. It can contain NULL values.
Nothing.
getRealEntry()
Retrieves one real entry from database corresponding to one reference entry.
TestRefEntries$getRealEntry(id)
id
The identifier of the entry.
A BiodbEntry instance.
getRefEntry()
Retrieves the content of a single reference entry.
TestRefEntries$getRefEntry(id)
id
The identifier of the reference entry to retrieve.
The content of the reference entry as a list.
getAllRefEntriesDf()
Load all reference entries.
TestRefEntries$getAllRefEntriesDf()
A data frame containing all the reference entries with their values.
clone()
The objects of this class are cloneable with this method.
TestRefEntries$clone(deep = FALSE)
deep
Whether to make a deep clone.
# Creates an instance refEntries <- TestRefEntries$new('comp.sqlite', pkgName='biodb') # Gets identifiers of all reference entries refEntries$getAllIds() # Gets a data frame with the content of the reference entries refEntries$getAllRefEntriesDf()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.