similar to: Help with tryCatch

Displaying 20 results from an estimated 700 matches similar to: "Help with tryCatch"

2011 Jul 05
2
Stuck ...can't get sapply and xmlTreeParse working
Can't seem to get the code below working. It gets stuck on line 24 inside the function hm; comments show the line in question. The function hm is called by sapply and is at the bottom of the code. Other stuff above line 24 works correctly including the first couple of lines of the function hm. Should I be using a different apply function or am I doing something wrong with xmlTreeParse ?
2011 May 28
1
newbie xml parsing question
I am trying to read some data off the zillow site. Newbie to xml, html, parsing and the xml package. I've been able to load the web page I'm interested with the following code but I'm not sure of the next step to get the information I'm interested in into R : library(XML) url <- "http://www.zillow.com/homes/511 W Lafayette St, Norristown, PA_rb" doc <-doc <-
2011 May 30
1
Need help reading website info with XML package and XPath
Hi, I'm looking for help extracting some information of the zillow website. I'd like to do this for the general case where I manually change the address by modifying the url (see code below). With the url containing the address, I'd like to be able to extract the same information each time. The specific information I'd like to be able to extract includes the homedetails url, price
2010 Mar 10
1
Joining elements of an array into a single element
Dear forum: I've been trying like for hours but I cannot solve this. I wonder if you could give me a hand. I would like to combine the following elements of an array which I must generate in order to get the syntax I need for another software, lets say: c<-c(1:7) zest<-c(12,34,45,132,56,23,6) p<-"[foresnat2]" for(i in 1:7){tre[i]<-paste("con(",p," ==
2006 Apr 18
12
Formatting data drawn from a DB
Question for all: Right now i have a Table in a mySQL DB that has a row called Ingredients. When the data is entered into the DB its enter like so from a text area: 1 1/2 lbs. beef top sirloin, thinly sliced 1/3 cup white sugar 1/3 cup rice wine vinegar 2 tablespoons frozen OJ concentrate 1 teaspoon salt 1 tablespoon soy sauce 1 cup long grain rice 2 cups water 1/4 cup cornstarch 2 teaspoons
2012 Aug 10
3
Parsing large XML documents in R - how to optimize the speed?
Hello everyone, I would like to parse very large xml files from MS/MS experiments and create R objects from their content. (By very large, I mean going up to 5-10Gb, although I am using a 'small' 40M file to test my code.) My first attempt at parsing the 40M file, using the XML package, took more than 2200 seconds and left me quite disappointed. I managed to cut that down to around 40
2012 Jun 06
1
Process XML files
Hello experts, Sorry for posting the SPlus related question here.. I have not found any solution yet after some attempts and hence, sending it to a wider spectrum of users! I was successful in processing files uing R's XML librariy. Thank you, Rxperts! I know there are libraries like XML and SPXML available in S-Plus. Could anyone please share examples of reading an xml file and save the
2008 Nov 05
2
How to extract following data
Hi everyone, I have this kind of raw dataset : - <Temp diffgr:id="Temp14" msdata:rowOrder="13"> <Date>2005-01-17T00:00:00+05:30</Date> <SecurityID>10149</SecurityID> <PriceClose>1288.40002</PriceClose> </Temp> - <Temp diffgr:id="Temp15" msdata:rowOrder="14">
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()
2007 Sep 01
2
Importing huge XML-Files
Dear all, for my diploma thesis I have to import huge XML-Files into R for statistical processing - huge means a size about 33 MB. I'm using the XML-Package version 1.9 As far as reading the complete file into R via xmlTreeParse doesn't work or is too slow, I'm trying to use xmlEventParse but I got completely stuck. I have many different type of nodes + <configuration>
2009 Dec 03
3
Scraping a web page
I would like to be able to submit a list of URLs of various webpages and extract the "content" i.e. not the mark-up of those pages. I can find plenty of examples in the XML library of extracting links from pages but I cannot seem to find a way to extract the text. Any help would be greatly appreciated - I will not know the structure of the URLs I would submit in advance. Any
2008 Sep 06
0
Tab control using FXRuby
In the sample program below I have a form of 6 text fields, in a scrolling window, followed by a row of function buttons. Problems: 1) For data entry purposes I''d like the function buttons NOT to be entered by pressing Tab keys, and retain their ''clickability'', but when the user Tab''s out of the last scrolling field (postcode) to have the form scroll to the
2008 Jul 02
1
Removing or overwriting an XML node
Hi, I have an existing XML document on disk, which I'd like to use as a template, and exchange a subnode with my own newly created subtree: <?xml version="1.0"?> <Duncan> <name a="1" b="xyz"> <first>Duncan</first> <last>Temple Lang</last> </name> </Duncan> created by e.g. ? library(XML)
2023 May 18
1
suprising behaviour of tryCatch()
G'day Federico, On Wed, 17 May 2023 10:42:17 +0000 "Calboli Federico (LUKE)" <federico.calboli at luke.fi> wrote: > sexsnp = rep(NA, 1750) > for(i in 1:1750){tryCatch(sexsnp[i] = fisher.test(table(data[,3], > data[,i + 38]))$p, error = function(e) print(NA))} Error: unexpected > '=' in "for(i in 1:1750){tryCatch(sexsnp[i] =" Try: R> for(i in
2011 Mar 10
1
tryCatch - Continuing for/next loop after error
Dear all, I am not sure I understand fully the functionality of "tryCatch" and "try" commands and how these are used to continue a for/next loop if an error occurs within the loop. Can somebody point me to material (or share some code) with more extensive examples than the ones in the help/FAQ pages? Do explain my problem in more detail: for (i in 100:1000) { ## do
2015 May 28
2
problemas con tryCatch
Buenos días, Quiero hacer una función con un "if", que si devuelve un error dentro de él se pare la ejecución de la función devolviendo un valor. El código que tengo, para las pruebas, es el siguiente: prueba<-function(a){ b<-"no ha hecho stop" c<-"hago el stop" if(a<3){ variable<-"hola" tryCatch({ write("entro en el
2007 Feb 12
2
help with tryCatch
Could smb please help with try-catch encapsulating a function for downloading. Let's say I have a character vector of symbols and want to download each one and surround by try and catch to be safe # get.hist.quote() is in library(tseries), but the question does not depend on it, I could be sourcing local files instead ans=null;error=null; for ( sym in sym.vec){
2011 May 04
1
tryCatch?
I would like to do inserts into a database table, but do updates in the fairly rare cases in which the inserts fail. I thought tryCatch might be the way to do it, but I honestly do not understand the help file for tryCatch at all. I thought something like this might work: for (i in seq(along = tbl$key)) { tryCatch(sqlSave(pg, tbl[i, ], "tbl", append = TRUE, rownames = FALSE),
2017 Dec 01
3
tryCatch in on.exit()
The following example involves a function whose on.exit() expression both generates an error and catches the error. The body of the function also generates an error. When calling the function wrapped in a tryCatch, should that tryCatch's error function be given the error from the body of the function, since the one from the on.exit has already been dealt with? Currently the outer tryCatch
2004 Jun 10
1
tryCatch() and preventing interrupts in 'finally'
With tryCatch() it is possible to catch interrupts with tryCatch(). Then you can use a 'finally' statement to clean up, release resources etc. However, how can I "protect" against additional interrupts? This is a concern when the hold down Ctrl+C and generates a sequence of interrupts. Example: tryCatch({ cat("Press Ctrl+C...\n"); Sys.sleep(5); }, interrupt =