similar to: tryCatch - Continuing for/next loop after error

Displaying 20 results from an estimated 5000 matches similar to: "tryCatch - Continuing for/next loop after error"

2011 Mar 18
2
Understanding tryCatch
I've read the help and the archives on tryCatch but I'm still stuggling trying to understand how it works exactly and how I can use it to get the result I need. I have a data.frame of urls which point to 11 .zip files. Basically I use RCurl to get the list of files from a ftp and then reduce that directory dump to the 11 zip files I want to download. Its easy enough to do that in a loop
2005 Jan 11
2
Changing the ranges for the axis in image()
Dear all, I can not find/understand the solution to this from the help pages: Say we have the following script: x<-matrix(c(1,1,0,1,0,1,0,1,1),3,3) image(x) How can I change the ranges on the vertical and horizontal axis to a range of my own or at least place a box frame around the image if I choose to use "axes=FALSE"? Apologies for such a bsic question and thanks beforehand
2011 Jun 03
2
tkrplot Newbie
Hello, I am trying to write a tcltk based program that plots/manipulates xts/xoo time series objects. I have the code I used from ## http://bioinf.wehi.edu.au/~wettenhall/RTclTkExamples/tkrplot.html : ## require(quantmod) require(tcltk) library(tkrplot) Sys.setenv(TZ="GMT") getSymbols("^GSPC", from = "1960-01-01") Myhscale <- 2.5 # Horizontal scaling
2010 Mar 22
4
Playwith on Mint
Hello, I am having trouble installing the package playwith on the latest Mint "helena", running R version 2.10.1 (2009-12-14). I suspect it has to do with the GTK library but as far as I can tell there is nothing wrong with it. Any help extremely appreciated. I include the output: > install.packages("playwith") Warning in install.packages("playwith") :
2011 Dec 04
3
Vectorization instead of loops problem
Hello, I am having problems vectorizing the following (i/o using a for/next/while loop): I have 2 sequences such as: x, y 1, 30 2, -40 0, 50 0, 25 1, -5 2, -10 1, 5 0, 40 etc etc The first sequence (x) takes integer numbers only: 0, 1, 2 The sequence y can be anything... I want to be able to retrieve (in a list if possible) the 3 last values of the y sequence before a value of 1 is
2010 Jan 28
3
Using tcltk or other graphical widgets to view zoo time series objects
Dear all, I am looking at the R-help entry below: http://finzi.psych.upenn.edu/R/Rhelp02/archive/26640.html I have a more complicatedt problem. I have a zoo time series frame with 100+ sequences. I want to cycle through them back and forth and compare them to the 1st column at any time. I need also a button to click when I need the viewed-selected sequence (that is being compared to the
2012 Nov 28
2
hhmm time format, strptime and %k
Hello, I am having trouble with the conversion specifications as described in the strptime help page. > head(dat) Date Time Open High Low Close Up Down Volume 1 11/19/2012 935 137.89 138.06 137.82 138.05 3202541 3013215 0 2 11/19/2012 940 138.04 138.40 138.02 138.38 2549660 2107595 4657255 3 11/19/2012 945 138.38 138.40 138.18 138.19 1627379 1856318 3483697 4
2007 Jun 14
1
names() after library(RDCOMClient) problem(?)
Hello, Try example(names) in R 2.5.0 after library(RDCOMClient) and you get > example(names) names> # print the names attribute of the islands data set names> names(islands) Error in names(islands) : no applicable method for "names" > Is this normal? Any way round it??? Best regards, Costas ---------------------------------- Costas Vorlow
2011 Apr 10
3
open.exe Virus W32.ATRAPS
Hello, I am not sure if this is the correct mailing list to send this email... I was trying to install on windows XP latest R-2.12.2 and my unvirus program (Immunet 3.0) reports a virus at open.exe while this is unpacked: W32.ATRAPS Has anyone come across the same problem? Best, Costas [[alternative HTML version deleted]]
2011 Apr 10
3
open.exe Virus W32.ATRAPS
Hello, I am not sure if this is the correct mailing list to send this email... I was trying to install on windows XP latest R-2.12.2 and my unvirus program (Immunet 3.0) reports a virus at open.exe while this is unpacked: W32.ATRAPS Has anyone come across the same problem? Best, Costas [[alternative HTML version deleted]]
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
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 Jul 10
1
Help with tryCatch
Having a hard time understanding the help files for tryCatch. Looking for a little help with the following statement which sits inside a for loop zest[i] <- tryCatch(sapply(getNodeSet(zdoc, "//zestimate/amount"), xmlValue), error=function() zest[i] <-"NA") zest is a numeric vector If the sapply statement evaluates to an error, I'd like to set the value of zest[i]
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
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 =
2023 May 18
1
suprising behaviour of tryCatch()
Because `<-` and `=` do different things (and I am one of the old fossils that wish they had not been confounded). `fun(x <- expr)` Assigns the value of `expr` to the variable `x` in the frame/environment that `fun` is called from. `fun(x = expr)` Assigns the value of `expr`to the variable `x` in the frame/environment created for and used by `fun` subject to the rules of argument matching.
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),
2023 May 17
4
suprising behaviour of tryCatch()
Hello, I run a fisher.test() in a loop, with the issue that some of the data will not be useable. To protect the loop I used tryCatch but: 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] =" But this works: for(i in
2004 Jun 14
1
Matrix_0.8-8 and norm() function
Hello and apologies if this is a stupid question (just rejoined the list): Has anything changed with the norm() function with the latest update of the Matrix library? My old code seems not to be working properly even for very simple tests of the norm function. I get too many "No direct or inherited method for function "norm" for this call" messages. I am using windows, R
2004 Nov 18
1
Time series plot orientation
Hello, I am trying to rotate by 90 degrees a time series plot. So I need the time axis to be the vertical one. Is there an easy way? I couldn't guess anything from the help pages. Apologies for a silly question. Regards, Costas -- ================================================================= This e-mail contains information intended for the addressee only. It may be confidential and