[R] Error in rm.outlier method

Marc Schwartz (via MN) mschwartz at mn.rr.com
Fri Apr 28 21:38:53 CEST 2006


Sachin,

I don't have a definitive thought, but some possibilities might be a
conflict somewhere in your environment with a local function or with one
in the searchpath.

Use ls() to review the current objects in your environment to see if
something looks suspicious. It did not look like 'outliers' is using a
namespace, so a conflict of some nature is a little more possible here.

Also use searchpaths() to get a feel for where R is searching for the
function. See what is getting searched "above" the outliers package in
the search order, which might provide a clue.

Also, try to start R from the command line using 'R --vanilla', which
should give you a clean working environment. Then use library(outliers)
and your code below to see if the same behavior is present. If so,
perhaps there was a corruption in the package installation. If not, it
would support some type of conflict or perhaps a corruption in your
default working environment.

HTH,

Marc

On Fri, 2006-04-28 at 11:57 -0700, Sachin J wrote:
> Hi Marc:
>  
> I am using rm.outlier() function from outliers package (reference:
> CRAN package help).
> You are right. I too couldn't find this error message in rm.outlier
> function. Thats why I am unable to understand the cause of error. Any
> further thoughts? I will take a look at the robust analytic methods as
> suggested.
>  
> Thanx
> Sachin 
>  
> 
> "Marc Schwartz (via MN)" <mschwartz at mn.rr.com> wrote:
>         On Fri, 2006-04-28 at 11:17 -0700, Sachin J wrote:
>         > Hi,
>         > 
>         > I am trying to use rm.outlier method but encountering
>         following error:
>         > 
>         > > y <- rnorm(100)
>         > > rm.outlier(y)
>         > 
>         > Error: 
>         > Error in if (nrow(x) != ncol(x)) stop("x must be a square
>         matrix") : 
>         > argument is of length zero
>         > 
>         > Whats wrong here?
>         > 
>         > TIA
>         > Sachin
>         
>         It would be helpful to know which rm.outlier() function you
>         are using
>         and from which package it comes.
>         
>         The only one that I noted in a search is in the 'outliers'
>         CRAN package
>         and it can take a vector as the 'x' argument.
>         
>         The above square matrix test and resultant error message is
>         not in the
>         tarball R code for either outlier() or rm.outlier() in that
>         package, so
>         the source of the error is unclear.
>         
>         As an aside, you may wish to consider robust analytic methods
>         rather
>         than doing post hoc outlier removal. A search of the list
>         archives will
>         provide some insights here. RSiteSearch("outlier") will get
>         you there.
>         
>         HTH,
>         
>         Marc Schwartz
>         
>         
> 
> 
> 
> 
> ______________________________________________________________________
> New Yahoo! Messenger with Voice. Call regular phones from your PC and
> save big.




More information about the R-help mailing list