Description Usage Arguments Details Value Author(s) References See Also Examples
Append new data to the data field of a GDS node.
1 | append.gdsn(node, val, check=TRUE)
|
node |
an object of class |
val |
R primitive data, like integer; or an object of class
|
check |
whether a warning is given, when appended data can not
match the capability of data field; if |
storage.mode(val)
should be "integer", "double", "character"
or "logical". GDS format does not support missing characters NA
,
and any NA
will be converted to a blank string ""
.
None.
Xiuwen Zheng
http://github.com/zhengxwen/gdsfmt
read.gdsn
, write.gdsn
,
add.gdsn
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 | # cteate a GDS file
f <- createfn.gds("test.gds")
# commom types
n <- add.gdsn(f, "int", val=matrix(1:10000, nrow=100, ncol=100),
compress="ZIP")
# no warning, and add a new column
append.gdsn(n, -1:-100)
f
# a warning
append.gdsn(n, -1:-50)
f
# no warning here, and add a new column
append.gdsn(n, -51:-100)
f
# you should call "readmode.gdsn" before reading, since compress="ZIP"
readmode.gdsn(n)
# check the last column
read.gdsn(n, start=c(1, 102), count=c(-1, 1))
# characters
n <- add.gdsn(f, "string", val=as.character(1:100))
append.gdsn(n, as.character(rep(NA, 25)))
read.gdsn(n)
# close the GDS file
closefn.gds(f)
# delete the temporary file
unlink("test.gds", force=TRUE)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.