list2file: transforms a list and writes it onto a text file

Description Usage Arguments Details Value Examples

View source: R/f0.rbsb1.code.r

Description

Transforms a list and writes it onto a text file. The reverse operation of file2list and the linking of list2char and char2file. See their description for complete details.

Usage

1
2
list2file(lili, file, path=".", tags=rbsb.tag1, stag=c("/", ";", "/"),
	  comment="#", comments=character(0), ap=FALSE)

Arguments

lili

The list structure to be transformed and written in file.

file

file to be written. According to ap when already exist, it will be destroyed and recreated or completed. But when equal to rbsb.cha0 no file is considered but the potential content of the file is returned as a character.

path

Directory containing the file.

tags

Character matrix with two columns indicating the opening and closing tags of the [sub]lists at different levels. Its row numbers gives the maximum accepted number of levels. Opening tags must be different.

stag

Three character strings indicating the tagging to define the separator for each character vector stag[2] between stag[1] and stag[3].

comment

At the beginning of a line, it indicates that this line must not be considered. This function will introduce its signature at the beginning of the file.

comments

Comments that the user want to be added at the beginning of the file.

ap

Must the file be appended if it already exist?

Details

No use is made of the general constant rbsb.mck, being reported in the called functions.
In any case, permission of writting must exist in the directory of the proposed path.

Value

Nothing but a file is created or modified when everything is right; except when file==rbsb.cha0, in that case a character is returned.

Examples

1
2
3
4
 rbsb3k("reset");
 list2file(rbsb.lis1, "toto.txt");
 unlink("toto.txt");
 list2file(rbsb.lis1, file=rbsb.cha0); 

rbsb documentation built on May 2, 2019, 4:41 p.m.

Related to list2file in rbsb...