Description Usage Arguments Value Side Effects Details Note See Also Examples
Writes either the C declaration of items in a list, or initializes them with the contents of the list.
1 2 3 |
x |
required. A list with names. |
file |
either |
item.num |
length three vector giving the number of items per line for doubles, integers and characters. |
indent |
length two vector giving the amount to indent declarations and the items in the initialization. |
declaration.only |
logical flag.
If |
long |
logical flag.
If |
append |
logical flag.
If |
if file is a non-empty character string, then the name of the file
that is written.
Otherwise, a character vector of the declarations – each element representing
a different line.
if file is a non-empty character string, then the file is created,
overwritten or appended.
The type to declare is dependent on the storage mode of the component of
x.
You may need to coerce components to get them to be declared the correct type.
Rcpp now probably makes most uses of this function obsolete.
.C, storage.mode, as.double,
as.integer, as.character, cat.
1 2 3 4 5 6 7 8 9 10 11 12 | test.list <- list(adoub=as.double(rnorm(20)), anint=as.integer(92:109),
achar=c("aaa", "bbbb", "ccccc"))
Cfrag.list(test.list, file="")
## Not run:
Cfrag.list(test.list, file="test.c")
Cfrag.list(test.list[1], file="test.c", dec=TRUE)
Cfrag.list(test.list[-1], file="test.c", dec=FALSE, append=TRUE)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.