diff --git a/src/interfaces/r/swig_typemaps.i b/src/interfaces/r/swig_typemaps.i index bbd512884f4..a37bf2761dc 100644 --- a/src/interfaces/r/swig_typemaps.i +++ b/src/interfaces/r/swig_typemaps.i @@ -42,6 +42,9 @@ extern "C" { $1 = (TYPEOF($input) == r_type && Rf_ncols($input)==1 ) ? 1 : 0; } +%typemap("rtypecheck") shogun::SGVector + %{ is.numeric($arg) %} + %typemap(in) shogun::SGVector { SEXP rvec=$input; @@ -101,6 +104,9 @@ TYPEMAP_OUT_SGVECTOR(INTSXP, INTEGER, "integer", uint16_t, int, "Word") $1 = (TYPEOF($input) == r_type) ? 1 : 0; } +%typemap("rtypecheck") shogun::SGMatrix + %{ is.numeric($arg) %} + %typemap(in) shogun::SGMatrix { if( TYPEOF($input) != r_type)