append.gdsn {gdsfmt} | R Documentation |
Append new data to the data field of a GDS node.
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
# 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)