hi,

new to R and using the car package to do some scatterplots with ellipses
hoping to add the area and center points of each ellipse to the legend?

looking for some direction / ideas.... here is the script, the data is where
golf shots end up by club.

        x (dispersion), y (distance), group (Club)

thanks, sam

## usage: Rscript shotScatter.R infile outfile level1 level2 minX maxX minY maxY
## load the library
   library(car)

## get the args
   args = commandArgs(TRUE);

## get the data format is: x, y, group
   Shot_Data <- read.table(args[1],
                         sep = ",",
                         header=T)

## setup the pdf file name
   pdf(file = args[2])

## do the plot
   scatterplot(y ~ x | Club, data=Shot_Data,
         ellipse = TRUE,
               levels = c(as.numeric(args[3]), as.numeric(args[4])),
               robust = TRUE,
               boxplots = "",
         xlab = "Dispersion",
         ylab = "Distance",
         xlim = c(as.numeric(args[5]), as.numeric(args[6])),
         ylim = c(as.numeric(args[7]), as.numeric(args[8])),
         smooth = FALSE,
         reg.line = FALSE)

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to