# 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)
Run the code above in your browser using DataLab