Displaying 6 results from an estimated 6 matches for "ppatel3026".
2008 Jun 17
2
try catch block
How can I use the try catch block such that if this statement fails
xml <- xmlTreeParse(xmlTxt, useInternal=TRUE)
then this statement is executed
xml <- xmlMalFormed()
?
This code does not work but assuming its somewhere along these lines:
tryCatch(xml <- xmlTreeParse(xmlTxt, useInternal=TRUE), xml <-
xmlMalFormed(f1))
--
View this message in context:
2008 Jun 19
2
Pattern Matching Replacement
I would like to replace "\r\n" with "" in a character string, where "\r\n"
exists only between < and >, how could I do that?
Initial:
characterString = "<XML><tag1
id=\"F\r\n2\"></t\r\nag1>\r\n<tag\r\n2></tag2></XML>"
Result:
characterString = "<XML><tag1
2008 Jun 17
1
Scan document including "\n"
How do you read in a whole file while preserving end of line "\n" characters?
Basically, read in a whole file as one string.
Ex:
<XML>
<TAG>
</TAG>
</XML>
After this file is read into a variable, it should really look like
"<XML>\n<TAG>\n</TAG>\n</XML>\n"
--
View this message in context:
2008 Jun 17
1
Error
My code seems to break out with error below for every 1000 files it
processes. Then I re-run from the last file where it errored out and it runs
without any bugs.
Any ideas what might cause error below?
Error in match(x, table, nomatch = 0) :
formal argument "nomatch" matched by multiple actual arguments
--
View this message in context:
2008 Jun 10
1
Parse XML
Could someone provide a link or examples of parsing XML document in R? Few
specific questions below:
For instance I can retrieve specific nodes using this:
node <- xpathApply(xml, "//" %+% xtag, xmlValue)
1) I want to be able to retrieve parent node for this node, how can I do
this? getParentNode() does not seem to cut it.
2) How can I retrieve children nodes for a particular
2008 Jun 25
0
Memory allocation failed: Copying Node
Following code bugs with "Memory allocation failed: Copying Node" error after
parsing n thousand files. I have included the main code(below) and
functions(after the main code).
I am not sure which lines are causing the copying Node which results in
memory failure. Please advise.
#Beginning of Code
for(i in 1:nrow(newFile)) {
if(i%%3000 == 0) gc()