Skip to content

R error function (NOT erf)

2 messages · Sachinthaka Abeywardana, Rolf Turner

#
Hi all,

I was wondering if it was possible to get R to throw an error if a 
certain condition was reached. For example:

if dim(A)[2]<=1
     error("Need a matrix not a vector")

thanks,
Sachin
#
On 17/11/11 18:54, Sachin Abeywardana wrote:
?stop

     cheers,

         Rolf Turner