Description Usage Arguments Value Author(s) References See Also Examples
Add a directory or a virtual folder to the GDS node.
1 2 |
node |
an object of class |
name |
the variable name; if it is not specified, a temporary name is assigned |
type |
"directory" (default) – create a directory of GDS node; "virtual" – create a virtual folder linking another GDS file by mapping all of the content to this virtual folder |
gds.fn |
the name of another GDS file; it is applicable only if
|
replace |
if |
visible |
|
An object of class gdsn.class
.
Xiuwen Zheng
http://github.com/zhengxwen/gdsfmt
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 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 | # create the first GDS file
f1 <- createfn.gds("test1.gds")
add.gdsn(f1, "NULL")
addfolder.gdsn(f1, "dir")
add.gdsn(f1, "int", 1:100)
f1
# open the GDS file
closefn.gds(f1)
##############################################
# create the second GDS file
f2 <- createfn.gds("test2.gds")
add.gdsn(f2, "int", 101:200)
# link to the first file
addfolder.gdsn(f2, "virtual_folder", type="virtual", gds.fn="test1.gds")
f2
# open the GDS file
closefn.gds(f2)
##############################################
# open the second file (writable)
(f <- openfn.gds("test2.gds", FALSE))
# + [ ]
# |--+ int { Int32 100, 400 bytes }
# |--+ virtual_folder [ --> test1.gds ]
# | |--+ NULL
# | |--+ dir [ ]
# | |--+ int { Int32 100, 400 bytes }
read.gdsn(index.gdsn(f, "int"))
read.gdsn(index.gdsn(f, "virtual_folder/int"))
add.gdsn(index.gdsn(f, "virtual_folder/dir"), "nm", 1:10)
f
# open the GDS file
closefn.gds(f)
##############################################
# open 'test1.gds', there is a new variable "dir/nm"
(f <- openfn.gds("test1.gds"))
closefn.gds(f)
##############################################
# remove 'test1.gds'
file.remove("test1.gds")
## Not run:
(f <- openfn.gds("test2.gds"))
# + [ ]
# |--+ int { Int32 100, 400 bytes }
# |--+ virtual_folder [ -X- test1.gds ]
closefn.gds(f)
## End(Not run)
# delete the temporary file
unlink("test.gds", force=TRUE)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.