Learn R Programming

TiddlyWikiR (version 1.0.1)

writeTags: Replace tags within a TiddlyWiki file.

Description

The function replaces one or more tags within a TiddlyWiki template file. It is intended to insert the results of the analysis within already existing tiddlers.

Usage

writeTags(x, tag = names(x), rep = x, file, infile = file, outfile = file, verbose = TRUE)

Arguments

x
a list
tag
a character vector containing the tags to be replaced.
rep
a list of the objects that will replace each tag.
file
TiddlyWiki template file.
infile
template file.
outfile
output file if required to be different from the input file.
verbose
verbose.

Details

A list with the tags to be replaced in its 'names' and the replacement objects in its 'elements' is required by the function.

Alternatively a character vector of tags and a list of replacements objects may be provided. When there is just one tag to be replaced 'x' or 'rep' may not be wrapped into the list structure; 'x' would be then a character vector of length one and 'rep' may be any object in R.

By default the TiddlyWiki template "file" will be overwritten. The options "infile" and "outfile" may be used not to overwrite the template.

A recommendation is to use something like @this_is_my_tag@ as a 'tag' to be replaced. This character string is generally unique so there Will not be any problem in overwriting it. Also the @ indicates a highlight in the TiddlyWiki syntax so you will track your tags easily in your writing.

See Also

writeTiddlers, wikify, gsub

Examples

Run this code
## Not run: 
#   writeTags (x, tag = names (x), rep = x, file = "myTemplate.html")
# ## End(Not run)

Run the code above in your browser using DataLab