obj2kvh {kvh} | R Documentation |
Formats an object before writing it in kvh file.
obj2kvh(obj, objname = NULL, conct = stdout(), indent = 0)
obj |
an R object |
objname |
character object name to write in kvh file |
conct |
connection opened for writing |
indent |
is tab offset for object name |
Scalar, vector, matrix and list are pre-processed.
Other objects are written as an output string of toString() function
To add a content to existent file use "a" as open mode
fcn=file("m.kvh", "a")
obj2kvh()
can be used along the code advancing in the calculations.
Writing in a subfield of an already started key requires use of
appropriate indent value. The file is started with indent=0 and
every sub-field increments the indent by 1.
If objname is NULL and obj is not a scalar value, the content of obj
is written in kvh file without additional indent.
None
m=matrix(1:6,2,3); fcn=file("m.kvh", "w"); obj2kvh(m, "m", fcn); close(fcn);