Displaying 3 results from an estimated 3 matches for "my_error".
Did you mean:
ml_error
2004 Mar 02
3
error() and C++ destructors
Hi,
I am writing C++ functions that are to be called via .Call() interface.
I'd been using error() (from R.h) to return to R if there is an error,
but then I realized that this might be not safe as supposedly error()
doesn't throw an exception and therefore some destructors do not get
called and some memory may leak. Here is a simple example
extern "C" void foo() {
string
2006 Sep 28
1
ramfs to tmpfs
...getprocinfo
static char cmdline[2048]; // contents of /proc/cmdline, after getprocinfo
static const char *getprocinfo(void);
/* error functions:
* error(fmt, ...) print "program: msg" and exits
* serror(fmt, ...) print "program: msg: error\n" and exits
*/
#define error(...) my_error(0, __VA_ARGS__)
#define serror(...) my_error(1, __VA_ARGS__)
static void __attribute__ ((noreturn,format(printf, 2, 3)))
my_error(int p, const char *fmt, ...)
{
va_list ap;
int err = errno;
va_start(ap, fmt);
fprintf(stderr, "%s: ", program);
vfprintf(stderr, fmt, ap);
if (p) fpr...
2017 Jun 12
2
Bucle for que se salte los errores
He encontrado la respuesta. EL ejemplo que puse era trivial, ya que es obvio que if(i ==0) entonces next, pero me referia a sin saber si va a ser error el modelo o no.
Para esto he encontrado la solución
for(i in -3:3){
tryCatch({
z<-1/i
> z<-z*z
> modelo<-lm(z~1)
}, error=function(e){print("es un error"})
}
Gracias de todas maneras!!!!!
Jesús