Rsamples/gc1.R

library(XML)
doc = xmlParse(system.file("exampleData", "mtcars.xml", package = "XML"))
nodes1 = getNodeSet(doc, "//record[@id='Mazda RX4']")
.Call("R_getXMLRefCount", nodes1[[1]])
nodes2 = getNodeSet(doc, "//record[@id='Mazda RX4']")
.Call("R_getXMLRefCount", nodes2[[1]])
.Call("R_getXMLRefCount", nodes1[[1]])

rm(doc)
gc()
rm(nodes1)
gc()
.Call("R_getXMLRefCount", nodes2[[1]])
gc()

rm(nodes2)
gc()

Try the XML package in your browser

Any scripts or data that you put into this service are public.

XML documentation built on Aug. 19, 2018, 5:03 p.m.