# cteate a GDS file
f <- createfn.gds("test.gds")
###################################################
n <- add.gdsn(f, "matrix", matrix(1:20, ncol=5))
read.gdsn(n)
write.gdsn(n, val=c(NA, NA), start=c(2, 2), count=c(2, 1))
read.gdsn(n)
###################################################
n <- add.gdsn(f, "n", val=1:12)
read.gdsn(n)
write.gdsn(n, matrix(1:24, ncol=6))
read.gdsn(n)
write.gdsn(n, array(1:24, c(4,3,2)))
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