search for: simpleerror

Displaying 20 results from an estimated 66 matches for "simpleerror".

2010 May 29
3
simpleError in storage.mode(y)
bonjour en travaillant avec un logiciel Multiple source methode, j'ai eu ce message d'erreur : simpleError in storage.mode(y) - "double": invalid to change the storage mode of a factor en recherchant sur le net , c'est un message universel svp, que signifiera ce message ? merci pour votre int?r?t anzid -- View this message in context: http://r.789695.n4.nabble.com/simpleError-in-storage...
2005 May 10
1
wish: print.condition and html (PR#7848)
Full_Name: Tom Short Version: 2.1.0 OS: Win2000 Submission from: (NULL) (68.236.159.160) print.condition prints out error messages enclosed in angle brackets as in: > simpleError("Sigh, yet another error...") <simpleError: Sigh, yet another error...> If R is used to generate HTML output (R2HTML or Rpad), then the error messages get hidden because browsers will skip right over the "<simpleError: Sigh, yet another error...>". Suggestion: remo...
2016 May 04
4
Is it possible to retrieve the last error? (not error *message*)
Hi, at the R prompt, is it possible to retrieve the last error (as in condition object of class "error")? I'm not asking for geterrmessage(), which only returns the error message (as a character string). I'm basically looking for a .Last.error or .Last.condition, analogously to .Last.value for values, which can be used when it is "too late" (not possible) to go back
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
2003 Nov 08
1
signalCondition
Does signalCondition() only work within try-catch blocks? I expected: testSignal <- function() { error <- simpleError("An error!") signalCondition(error) } to do the same thing as testStop <- function() { error <- simpleError("An error!") stop(error) } but testSignal returns NULL without throwing an error. Have I misunderstood something? Thanks, Hadley
2023 Nov 20
1
Calculating volume under polygons
Dear all; I am trying to calculate volume under each polygon of a shapefile according to a DEM. when I run the code, it gives me an error as follows. " Error in h(simpleError(msg, call)) : error in evaluating the argument 'x' in selecting a method for function 'addAttrToGeom': sp supports Z dimension only for POINT and MULTIPOINT. use `st_zm(...)` to coerce to XY dimensions " I want to have a table that contains one column corresponding to the pol...
2017 Nov 01
2
R-3.4.2: make check stops at line 698 of tests/reg-tests-1d.R
...; tools::assertWarning(ap1 <- available.packages(repos = "http://foo.bar")) > >> tools::assertWarning(ap2 <- available.packages(repos = "http://foo.bar")) > > error in assertCondition(expr, "warning", > > .exprString = d.expr) : Got simpleError evaluating of ap2 <- > > available.packages(repo ...: wanted warning > > > > The error message is a result of: ap2 <- available.packages(repos = > > "http://foo.bar"), > > not of the following condition in the test script: stopifnot(nrow(ap...
2019 Mar 02
1
stopifnot
...special case for decently written 'all.equal(*)': if(is.call(cl.i) && identical(cl.i[[1]], quote(all.equal)) && (is.null(ni <- names(cl.i)) || length(cl.i) == 3L || @@ -84,7 +83,12 @@ "%s are not all TRUE"), Dparse(cl.i)) - stop(simpleError(msg, call = sys.call(-1))) + n <- sys.nframe() + if((p <- n-3) > 0 && + identical(sys.function(p), sys.function(n)) && + eval(expression(!missE), p)) # originally stopifnot(exprs=*) + n <- p + stop(simpleError(msg, call = if(n > 1) sys.call(...
2019 Mar 05
2
stopifnot
Another possible shortcut definition: assert <- function(exprs) do.call("stopifnot", list(exprs = substitute(exprs), local = parent.frame())) After thinking again, I propose to use ??? ? ? stop(simpleError(msg, call = if(p <- sys.parent()) sys.call(p))) - It seems that the call is the call of the frame where stopifnot(...) is evaluated. Because that is the correct context, I think it is good. - It is simpler and also works for call that originally comes from stopifnot(exprs=*) . - It allows short...
2017 Nov 01
2
R-3.4.2: make check stops at line 698 of tests/reg-tests-1d.R
...caching in case of errors > tools::assertWarning(ap1 <- available.packages(repos = "http://foo.bar")) > tools::assertWarning(ap2 <- available.packages(repos = "http://foo.bar")) error in assertCondition(expr, "warning", .exprString = d.expr) : Got simpleError evaluating of ap2 <- available.packages(repo ...: wanted warning The error message is a result of: ap2 <- available.packages(repos = "http://foo.bar"), not of the following condition in the test script: stopifnot(nrow(ap1) == 0, identical(ap1, ap2)) . ap1 <- availab...
2017 Nov 01
0
R-3.4.2: make check stops at line 698 of tests/reg-tests-1d.R
...sertWarning(ap1 <- available.packages(repos = "http://foo.bar")) >>>> tools::assertWarning(ap2 <- available.packages(repos = "http://foo.bar")) >>> error in assertCondition(expr, "warning", >>> .exprString = d.expr) : Got simpleError evaluating of ap2 <- >>> available.packages(repo ...: wanted warning >>> >>> The error message is a result of: ap2 <- available.packages(repos = >>> "http://foo.bar"), >>> not of the following condition in the test script: st...
2019 Mar 05
0
stopifnot
..., do.call() is a heavy hammer I only like to use when needed.. Or would there be advantages of this version? Indeed (as you note below) one important consideration is the exact message that is produced when one assertion fails. > After thinking again, I propose to use > ??? ? ? stop(simpleError(msg, call = if(p <- sys.parent()) sys.call(p))) That would of course be considerably simpler indeed, part "2 a" of these: > - It seems that the call is the call of the frame where stopifnot(...) is evaluated. Because that is the correct context, I think it is good. > -...
2017 Nov 01
0
R-3.4.2: make check stops at line 698 of tests/reg-tests-1d.R
...errors >> tools::assertWarning(ap1 <- available.packages(repos = "http://foo.bar")) >> tools::assertWarning(ap2 <- available.packages(repos = "http://foo.bar")) > error in assertCondition(expr, "warning", > .exprString = d.expr) : Got simpleError evaluating of ap2 <- > available.packages(repo ...: wanted warning > > The error message is a result of: ap2 <- available.packages(repos = > "http://foo.bar"), > not of the following condition in the test script: stopifnot(nrow(ap1) > == 0, identical(a...
2014 Feb 26
1
help with gotoExitingHandler(R_NilValue, call, entry); . Implementation of error handling internally
...context inside the function, install my own handler that I don?t set to be a calling one, pretend this context is a CTXT_FUNCTION. Eventually I get to jump fun, so that I can later on grab the condition from R_ReturnedValue. This works well in the ? not simple error ? case, i.e. if I call stop( simpleError(...) ), but with simple errors, i.e. calls to Rf_error internally or bare calls to stop( "vvzvz" ) I can?t access the error. And this boils down to this call: gotoExitingHandler(R_NilValue, call, entry); inside vsignalError : static void vsignalError(SEXP call, const char *format,...
2017 Nov 01
2
R-3.4.2: make check stops at line 698 of tests/reg-tests-1d.R
...<- available.packages(repos = "http://foo.bar")) > >>>> tools::assertWarning(ap2 <- available.packages(repos = "http://foo.bar")) > >>> error in assertCondition(expr, "warning", > >>> .exprString = d.expr) : Got simpleError evaluating of ap2 <- > >>> available.packages(repo ...: wanted warning > >>> > >>> The error message is a result of: ap2 <- available.packages(repos = > >>> "http://foo.bar"), > >>> not of the following condition...
2013 Apr 09
5
Error when using fitdist function in R
...amma(c(363328L, 376216L, 367032L, 314826L, 311892L, 313340L, : NaNs produced [1] "Error in optim(par = vstart, fn = fnobj, fix.arg = fix.arg, obs = data, : \n non-finite finite-difference value [2]\n" attr(,"class") [1] "try-error" attr(,"condition") <simpleError in optim(par = vstart, fn = fnobj, fix.arg = fix.arg, obs = data, ddistnam = ddistname, hessian = TRUE, method = meth, lower = lower, upper = upper, ...): non-finite finite-difference value [2]> Error in fitdist(k, "gamma") : the function mle failed to estimate the parameters...
2012 Aug 09
4
R Commander - Time Series
...ab. I load my variable D1 Ln Demand (1st differenced ln demand). I set my regular and seasonal p d q settings hit run and I get: [1] "Error in list(order = c(0, 1, 0), period = ) : argument 2 is empty\n" attr(,"class") [1] "try-error" attr(,"condition") <simpleError in list(order = c(0, 1, 0), period = ): argument 2 is empty> I assume it means the period is empty? But there was no option to set that. It says in the messages sections: [4] ERROR: argument 2 is empty [5] ERROR: the model ArimaModel.1 is no longer available [6] ERROR: There are no models f...
2020 Mar 24
0
help with rchk warnings on Rf_eval(Rf_lang2(...))
...cpp_fast_eval(call, R_GlobalEnv); Good catch. And recursive grep for Rf_lang2 in the Rcpp sources tree suggests this is as the common pattern in all other instances. Dirk edd at rob:~/git/rcpp(master)$ ag Rf_lang2 inst/include/ inst/include/Rcpp/exceptions.h 360: Rcpp::Shield<SEXP> simpleErrorExpr(Rf_lang2(::Rf_install("simpleError"), txt)); 365: Rcpp::Shield<SEXP> simpleErrorExpr( Rf_lang2(::Rf_install("simpleError"), tryError )); 388: Rcpp::Shield<SEXP> expr( Rf_lang2( stop_sym , condition ) ) ; 395: Rcpp::Shield<SEXP> expr( Rf_lang2(...
2018 Feb 21
1
Checking for a proper "stop" statement...
Folks: Consider the following two use cases: goodfunction <- function() { stop("Something went wrong..." } # vs. badfunction <- function() { notgood() } Is there a way for me to test if the functions make use of a stop() statement WITHOUT modifying the stop() output (assume I can't mod the function containing the stop() statement itself)? For "goodfunction" the
2019 Mar 02
0
stopifnot
...itten 'all.equal(*)': if(is.call(cl.i) && identical(cl.i[[1]], quote(all.equal)) && (is.null(ni <- names(cl.i)) || length(cl.i) == 3L || @@ -84,7 +83,12 @@ "%s are not all TRUE"), Dparse(cl.i)) - stop(simpleError(msg, call = sys.call(-1))) + n <- sys.nframe() + if((p <- n-3) > 0 && + identical(sys.function(p), sys.function(n)) && + eval(expression(!missE), p)) # originally stopifnot(exprs=*) + n <- p + stop(simpleError(msg, call = if(...