write_file: Write file method

Description Usage Arguments Details Value Methods (by class) Note Author(s) See Also Examples

Description

Write a file for the specified object

Usage

1
2
3
4
5
6
write_file(object, filepath, append = FALSE,
  encoding = getOption("encoding"), ...)

## S4 method for signature 'ScriptOutput'
write_file(object, filepath = "dmscript",
  append = FALSE, encoding = getOption("encoding"), ...)

Arguments

object

Object to be written as a ScriptOutput object.

filepath

Where to write the file. No need to add the extension, it will be put following the language of ScriptOutput. If an extension is given, then it will be used

append

Append Append the file. FALSE by default.

encoding

Character encoding to use. Use the default encoding if not specified.

...

other options for specific methods

Details

If the object is a ScriptOutput object, it will write a script skeleton file .

Value

Return invisibly the file path of the new file

Methods (by class)

Note

Will be extended to others vartors objects in future releases. I don't use the write function because it is not a S3 or a S4 method and it's hard to promote in a good way.

Author(s)

Joris Muller

See Also

ScriptOutput-class

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
# Import a data.frame containing the description of the variables
# Show the description of the variable
sample_descvar

# Create the script skeleton simply with create_script()
script_skeleton <- create_script(sample_descvar)
# watch the result
script_skeleton
# Could be written in a file with the write() method
## Not run: 
write_file(script_skeleton)

## End(Not run)

jomuller/vartors documentation built on May 19, 2019, 7:26 p.m.