odg_draft: Copy a draft template file for a odg graphics

View source: R/odg_graphics.R

odg_draftR Documentation

Copy a draft template file for a odg graphics

Description

This function odg_draft works analogously to rmarkdown::draft, but for ODG graphics files. The template can either be specified with an explicit path or in connection with the parameter package where the latter assumes that package is installed and contains a directory rmarkdown/templates/<template_name>. In both options the template-directory must contain a file called template.yaml with meta information about the template and a subdirectory skeleton with all the files that are to be copied to the directory where the target file is expected to be. When the parameter create_dir is specified either as function parameter or as meta-information a separate directory for the target file is created. In case it is needed, the appropriate file extension is pasted to the name of the target file. In this specific case the extension we are using here is .odg. The list of files in the skeleton subdirectory of the template directory is copied to the path where the target file is supposed to be. The copying of the files can be specified with an option that indicates whether existing files should be overwritten. The last step consists of renaming the skeleton-file to the basename given in the file parameter.

Usage

odg_draft(
  file,
  template = "odg_figure",
  package = NULL,
  create_dir = "default",
  pbOverwrite = FALSE
)

Arguments

file

name of the and path to the new document

template

name of the template

package

package where template can be found

create_dir

whether or not to create a new directory for this document

pbOverwrite

should existing files be overwritten

Value

file name of the and path to the new document


charlotte-ngs/rmdhelp documentation built on Oct. 31, 2023, 10:21 a.m.