writeCode: Write the generated code to a stream/connection.

writeCodeR Documentation

Write the generated code to a stream/connection.

Description

These methods handle writing the generated code to a directory, file or connection so that the code can be used in future R sessions.

Usage

writeCode(def, file = stdout(), context = NULL,
           prepend = character(),
           enumsAsValues = TRUE, 
           namespace = "NAMESPACE",
           ...)
writeNamespace(ns, nsFile = "NAMESPACE", copy = character())

Arguments

def

the code definitions to be written.

file

the connection to which the code will be written. If this is a directory, individual files are created for each class.

context

contextual information that can govern the output of the code.

prepend

a character vector giving the fully-qualified names of files whose contents are to be inserted before the generated code. If the output is to a directory, these files are just copied directly there as separate files with the same names as given.

enumsAsValues

a logical value that is passed as the third argument to writeEnums and this controls whether the individual name-value pairs within an enumeration definition are defined as separate, individual R variables.

namespace

a character vector giving the name of the file to which the name space information, e.g export, exportClasses, etc., should be written. This defaults to the usual NAMESPACE. To avoid having the name space information written, specify either NA or character().

...

any additional information that is passed onto the different methods.

ns

the name space information returned from writeCode which is to be written to the file given by nsFile.

nsFile

the name of the file to which the name space information is to be written. This is a character vector.

copy

the fully-qualified names of any addtional files whose contents are to be copied into the resulting NAMESPACE file. These are appended to the end of the newly generated NAMESPACE file.

Author(s)

Duncan Temple Lang <duncan@wald.ucdavis.edu>

References

http://www.omegahat.org/SWinTypeLibs

See Also

define computeFunctionInformation


omegahat/SWinTypeLibs documentation built on Jan. 17, 2024, 6:40 p.m.