Write data to a GDS node

Share:

Description

Write data to a GDS node.

Usage

1
write.gdsn(node, val, start=NULL, count=NULL, check=TRUE)

Arguments

node

an object of class gdsn.class, a GDS node

val

the data to be written

start

a vector of integers, starting from 1 for each dimension

count

a vector of integers, the length of each dimnension

check

if TRUE, a warning will be given when val is character and there are missing values in val

Details

start, count: The values in data are taken to be those in the array with the leftmost subscript moving fastest.

start and count should both exist or be missing. If start and count are both missing, the dimensions and values of val will be assigned to the data field.

GDS format does not support missing characters NA, and any NA will be converted to a blank string "".

Value

None.

Author(s)

Xiuwen Zheng

References

http://github.com/zhengxwen/gdsfmt

See Also

append.gdsn, read.gdsn, add.gdsn

Examples

 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
# 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 file
closefn.gds(f)


# delete the temporary file
unlink("test.gds", force=TRUE)

Want to suggest features or report bugs for rdrr.io? Use the GitHub issue tracker.