Rev Language Reference


write - Write RevObject to file

This function write values in a RevObject to a file specified by the user.

Aliases

  • print

Usage

write(RevObject ..., RevObject ..., String filename, Bool append, String separator)

Arguments

... : RevObject (pass by value)
A variable to write.
... : RevObject (pass by const reference)
Additional variables to write.
filename : String (pass by value)
Writing to this file, or to the screen if name is empty.
append : Bool (pass by value)
Append or overwrite existing file?
Default : FALSE
separator : String (pass by value)
How to separate values between variables.
Default :

Return Type

Details

This function accepts multiple RevObjects in the first arguments to be written to a file. After this, users can specify the filename with a string which can include the directory path to where the file should be made. Users can also specify whether to append or overwrite the file using a boolean operator (default is false). Lastly, a seperator can be specified using a string for specifying how to separate values in the RevObject (default is "").

Example


# define RevObject to write
    x <- matrix([[1, 1],[1, 1]])
# write to CSV file
    write(x, "/path/to/file/filename.csv", false, ",")

See Also