Description Usage Arguments Details Examples
These functions define the high-level, user-facing trackr API.
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 | record(
  object,
  db = defaultTDB(),
  resultURI = "",
  code = histry::histry_tracker(),
  force = FALSE,
  verbose = FALSE,
  symorpos = NULL,
  dryrun = FALSE
)
rmRecord(object, db = defaultTDB(), verbose = FALSE)
findRecords(
  pattern,
  db = defaultTDB(),
  fields = NULL,
  ret_type = c("doclist", "id", "backend"),
  verbose = FALSE
)
recordFiles(
  object,
  ingestfun = NULL,
  db = defaultTDB(),
  resultURI = "",
  code = histry_tracker(),
  force = FALSE,
  verbose = FALSE,
  symorpos = NULL,
  dryrun = FALSE
)
 | 
| object | ANY. An object to record. Or (for recordFiles) a vector of one or more files to record or the path of a single directory whose contents will be recorded. Or (for rmPlot) the unique ID of an object in the database to remove. | 
| db | TrackrDB. The database | 
| resultURI | A URI which can be used to define a grouping/hierarchy of results recorded via trackr. Currently unused by trackr itself except as additional metadata to search across. Defaults to an empty string. | 
| code | ANY. Code/evaluation history to be associated with
 | 
| force | logical. Overwrite any existing entry matching
 | 
| verbose | logical. Should extra informative messages be displayed ( default: FALSE) | 
| symorpos | The symbol or position corresponding to
 | 
| dryrun | logical. Should a "dry run" be performed. If true,
the  | 
| pattern | character. A regular expression to match against the text in  | 
| fields | character or NULL. The fiends in which to match, or NULL to include all fields. | 
| ret_type | character. Format in which to return the response. Options are: "id" - id of matching documents (default), "list" - A list containing the matching documents represnted as R lists, and "backend" - a backend specific representation of the set of matching documents | 
| ingestfun | function or NULL. A function which must accept
only the paths argument which will take  | 
These functions allow end-users to interact with trackr databases. Each function does what its name suggests.
When more than one file is passed to
recordFiles,either via a vector of paths or the path to
a directory, the files will be zipped up into a single file
which will be recorded.
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | prevtdb = defaultTDB()
defaultTDB(listTDB(img_dir = tempdir()))
mt = datasets::mtcars
record(mt)
res = findRecords("mtcars")
stopifnot(length(res) ==1)
rmRecord(mt)
res = findRecords("mtcars")
stopifnot(length(res) == 0)
## Not run: 
f = function(paths) readLines(paths)
fil = system.file("test_docs", "knitr_test.Rmd", package = "trackr")
recordFiles(fil, ingestfun = f)
res= findRecords("test_docs")
## End(Not run)
defaultTDB(prevtdb)
 | 
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.