0

I am trying to plot an ellipse in R but getting an error message. Here is my code:

library(mixtools)       ###I also tried library(ellipse)
mu<-c(.564,.603)
sigma<-matrix(c(0.0144,0.0117,0.0117,0.0146),2)
ellipse(mu,sigma,alpha=0.95,npoints=200,newplot=TRUE,type="l")

Result:

Error in ellipse(mu, sigma, alpha = 0.05, npoints = 200, newplot = TRUE,  : 
unused arguments (alpha = 0.05, npoints = 200, newplot = TRUE, type = "l")

Then I tried just this:

ellipse(mu, sigma)

Result:

Error in ellipse(mu, sigma) : argument "vec" is missing, with no default

I am not sure argument "vec" is missing unless i do not know what that means.

I then turned my "mu" into a matrix may be that will help but got same result.

mu<-matrix(c(.564,.603),ncol=1)
sigma<-matrix(c(0.0144,0.0117,0.0117,0.0146),2)
ellipse(mu,sigma,alpha=0.05,npoints=200,newplot=TRUE,type="l")

I uninstalled R and re-istalled the latest but to no avail.

I checked: ??ellipse

I seem to be writing the code correctly but with no success.

Your assistance is appreciated.

flodel
  • 87,577
  • 21
  • 185
  • 223
  • 3
    Try using `mixtools::ellipse(...)` instead of `ellipse(...)`. Your code works for me but somehow the error message you get suggests that you have another `ellipse` function defined earlier in the search path. – flodel Nov 02 '14 at 00:45
  • @flodel: Thanks very much, mixtools::ellipse(...) did work. I have been trying this for almost 4 weeks, I stopped trying after a while. – adejames2000 Nov 02 '14 at 18:54

0 Answers0