put.attr.gdsn: Add an attribute into a GDS node

Description Usage Arguments Details Author(s) References See Also Examples

View source: R/gdsfmt-main.r

Description

Add an attribute to a GDS node.

Usage

1
put.attr.gdsn(node, name, val=NULL)

Arguments

node

an object of class gdsn.class, a GDS node

name

the name of an attribute

val

the value of an attribute

Details

Missing values are allowed in a numerical attribute, but not allowed for characters or logical values. Missing characters are converted to "NA", and missing logical values are converted to FALSE.

Author(s)

Xiuwen Zheng

References

http://github.com/zhengxwen/gdsfmt

See Also

get.attr.gdsn, delete.attr.gdsn

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
# cteate a GDS file
f <- createfn.gds("test.gds")

node <- add.gdsn(f, "int", val=1:10000)
put.attr.gdsn(node, "missing.value", 10000)
put.attr.gdsn(node, "one.value", 1L)
put.attr.gdsn(node, "string", c("ABCDEF", "THIS"))
put.attr.gdsn(node, "bool", c(TRUE, TRUE, FALSE))

f
get.attr.gdsn(node)

delete.attr.gdsn(node, "one.value")
get.attr.gdsn(node)

closefn.gds(f)


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

gdsfmt documentation built on May 2, 2019, 4:41 p.m.