Displaying 20 results from an estimated 500 matches similar to: "rpart error message"
2008 Sep 10
1
help: error handling in try
First time to post and searched archive for this problem with no clue. My version is 2.5.1.
Below is a function to check if a given date is a valid date to a given date function object. It uses try (also tried tryCatch but with same problem). When given an invalid date, I am hoping try will generate en error message which would be picked up by the geterrmessage and thus expecting a false result.
2012 Oct 31
1
Strange compiling behaviour
Compiling this little function gets me some strange behaviour
.initDataDir <- function(){
if(file.exists(LOCATION)) {
if(as.logical(file.info(LOCATION)["isdir"]))return
stop(LOCATION, " exists but is not a directory")
}
Z <- dir.create(LOCATION)
if(!Z){
stop(geterrmessage())
## stop("Juggel")
}
return(Z)
}
> .initDataDir <-
2005 May 18
1
Testing for warning inside functions
I am looking for a way to get a warning message
immediately after an evaluation within a function.
To get error messages you can use geterrmessage().
But I found no function that allows me to check for
warnings.
Five years ago this questions has been posted
but I haven't found any answer.
Thanks for any help.
Peter Wolf
------------
For illustration purpose a simple example follows:
you
2018 Feb 22
0
Problem with geterrmessage()
Only the default error handler puts the error message in a buffer
where it can be retrieved with geterrmessage. try() replaces the
default error handler. Either look at the value returned by try() or
use tryCatch with conditionMessage.
Best,
luke
On Thu, 22 Feb 2018, Dennis Fisher wrote:
> R 3.4.3
> OS X
>
> Colleagues
>
> I have a 20K line script in which I encounter an
2018 Feb 22
2
Problem with geterrmessage()
Luke
Thanks ? I revised the code to:
ERRORMESSAGE <- try(source(USERSCRIPTFILE, local=T), silent=T)
print(ERRORMESSAGE) now returns:
$value
[1] 0
$visible
[1] FALSE
Not clear what to make of that.
Dennis
Dennis Fisher MD
P < (The "P Less Than" Company)
Phone / Fax: 1-866-PLessThan (1-866-753-7784)
www.PLessThan.com
> On Feb 22, 2018, at 12:45 PM, luke-tierney at
2018 Feb 22
2
Problem with geterrmessage()
R 3.4.3
OS X
Colleagues
I have a 20K line script in which I encounter an unexpected problem.
If the script detects presence of a particular file USERCODE.txt, it executes:
source(?USERCODE.txt?)
If that file is not present, the script executes without a problem.
There might be syntax errors in USERCODE.txt; therefore, the code above is embedded in a try command:
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
2019 Jun 08
2
Determining the exit code of an "almost finished" R script
Dear All,
I'm using "reg.finalizer" in a function that is to be called in R scripts
to do some cleanup on success. I have not found a way to run the function
only if the script run without errors, so when the exit code is expected to
be 0.
What I've tried is checking "geterrmessage()", but unfortunately it's not
perfect: if an error was handled with eg
2019 Jun 08
2
Determining the exit code of an "almost finished" R script
On Sat, Jun 8, 2019 at 2:13 PM Duncan Murdoch <murdoch.duncan at gmail.com> wrote:
>
> On 08/06/2019 7:42 a.m., Gergely Dar?czi wrote:
> > Dear All,
> >
> > I'm using "reg.finalizer" in a function that is to be called in R scripts
> > to do some cleanup on success. I have not found a way to run the function
> > only if the script run without
2008 Jun 19
1
Appending diagnostic information to all lines sent to stdout and stderr
Dear All
I'm logging the stdout and stderr of an R program into two separate
files (stderr.txt and stdout.txt) using sink()
I would like to append extra information such as "date", "memory
usage" etc to every line of output that goes to stdout or stderr.
For example
> cat("hello \n")
should give output that looks something like:
"hello --- Thu Jun 19
2004 Mar 11
2
No traceback available when using try(...)
Hello,
1. The Situation :
------------------------
The stack traceback is not available when error ouccured in a try(....)
-- test.R --------------------------------
f<-function(a){
return ( log(a) )
}
try(f("A"))
traceback()
-------------------------------------------
I get the following message :
> try(f("A"))
Error in log(x) : Non-numeric argument to mathematical
2007 Dec 10
1
Multiple Reponse CART Analysis
Dear R friends-
I'm attempting to generate a regression tree with one gradient predictor and multiple responses, trying to test if change in size (turtle.data$Clength) acts as a single predictor of ten multiple diet taxa abundances (prey.data) Neither rpart or mvpart seem to allow me to do multiple responses. (Or if they can, I'm not using the functions properly.)
> library(rpart)
2009 Jul 26
3
Question about rpart decision trees (being used to predict customer churn)
Hi,
I am using rpart decision trees to analyze customer churn. I am finding that
the decision trees created are not effective because they are not able to
recognize factors that influence churn. I have created an example situation
below. What do I need to do to for rpart to build a tree with the variable
experience? My guess is that this would happen if rpart used the loss matrix
while creating
2010 May 05
1
testInstalledBasic question
Hi,
I'm currently in the process of writing an R-installation SOP for my
company. As part of that process I'm using the recommendations from the 'R
Installation and Administration' document, section 3.2, "Testing an
installation". This is done on an XP machine, using the latest binary of
2.11.0.
The binary is downloaded and then installed from the installer. I then
2008 Jun 02
2
Problemas usando jri0.4-1 y R 2.7.0
Hola, es la primera vez que mando un correo a cualquiera de las listas de
correo de R y no se si esta consulta se ajusta al próposito de la r-help
list o deberÃa haberlo mandado a otra de las listas que hay.
Mi problema es el siguiente: Estoy desarrollando un programa en java con
llamadas a R y no puedo usar jri 0.4-1 con la version 2.7 o 2.6 de R.
Curiosamente si me funciona si uso jri 0.4 o la
2009 Feb 28
2
Using JRI and Java 1.6 on MAC OS X
Dear R-Help,
I am trying to get JRI (the rJava interface allowing Java to connect
to R) to work. I was able to run it a week ago when I was doing some
testing using Java 1.5. However, I am developing a GUI application
using some of the new Java 1.6 features and I just can't get JRI to
work with this setup.
Here is what I get:
Cannot find JRI native library!
Please make sure that the JRI
2008 May 16
2
Getting JRI/rJava to work
Hello All
I am trying to get the JRI examples from rJava to work on Windows XP and
failing. (And as a more general and connected question is there any
review/summary of front-end software for R?)
I have installed rJava from the Windows binary supplied. I compile and
run the example supplied (rtest.java) and get the results below. I do
not think the notes about a deprecated API are a problem. But
2007 Sep 13
3
Someone Using Java/R Interface--- JRI ?
Hi all,
I am writing R code and I want to interface with JAVA i.e. I want to call R
from JAVA. That's why i have installed JRI on my machine.
There is also documentation available in "Javadoc".
But as i am very new to JAVA and well as R, I don't understand much of it.
If someone is using this package i.e. JRI, please let me know whether i am
going in right direction or not.
2006 Sep 28
2
calling R from within Java, using jri
Hi,
I want to call R from within Java, using jri as per
http://www.rosuda.org/software/jri/
So I am following the instructions in the README file for JRI 0.2-4.
I have run 'sh configure.win' and 'make' and they seemed to be
successful.
(See below for the output from make, for example.)
But when I try 'run.bat rtest' (with and without R command line
arguments)
the output
2009 Jun 25
2
JRI - problem to access "stats" package
Hello,
I am a new R user. More precisely, I am working with JRI (on a Eclipse
Java6 project under Ubuntu9).
I have difficulties to access some R packages (For example: package
"stats", object "Normal", function "pnorm").
I have tried many solutions to set the right path but nothing have succeed:
For example: