[R] subscripted assignments errormessage in gap.boxpot

From: Megan J Bellamy <bellammj_at_gov.ns.ca>
Date: Wed, 25 Jun 2008 14:36:12 -0300


I am trying to create a boxplot that has a gap with different scales so that my boxes actually show (compare attachments). I have referred to the help pages for gap.boxplot, gap.plot, list with no luck so far. Here is my script and the resulting error message:

# Import *.csv files containing areas for each CLI class

cli3<-read.table("F:\\Megan\\cli3.csv", header=TRUE, sep=",")
cli4<-read.table("F:\\Megan\\cli4.csv", header=TRUE, sep=",")
cli5<-read.table("F:\\Megan\\cli5.csv", header=TRUE, sep=",")
cli6<-read.table("F:\\Megan\\cli6.csv", header=TRUE, sep=",")
cli7<-read.table("F:\\Megan\\cli7.csv", header=TRUE, sep=",")

# Attach these to the dataframe

attach(cli3)
attach(cli4)
attach(cli5)
attach(cli6)
attach(cli7)


# Calculate box and whisker values for each file

#CLI3<-(quantile(hectares))

#CLI4<-(quantile(hectares2))

#CLI5<-(quantile(hectares3))

#CLI6<-(quantile(hectares4))

#CLI7<-(quantile(hectares5))

# Set margins for plot area
par(mar=c(5, 5, 3, 1))

#classes<-list(cli3, cli4, cli5, cli6, cli7)

classes<-c(cli3, cli4, cli5, cli6, cli7) gap.boxplot(classes,gap=list(top=c(8000,28000), bottom=c(0,250)), range=5, main=NULL)

#par(ask=FALSE)



Error in bxgap$out[bxgap$out > gap$top[2]] <- bxgap$out[bxgap$out > gap$top[2]] - :   NAs are not allowed in subscripted assignments

I am not quite sure what 'subscripted assignments' means. I tried substituting the 'classes<-list...' for the 'classes<-c(cli3...)' and got this error instead: Error in sort.list(x) : 'x' must be atomic for 'sort.list' Have you called 'sort' on a list?

I have tried looking up the help for lists and is.list but am not sure what I am missing.



R-help_at_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. Received on Wed 25 Jun 2008 - 15:24:00 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Wed 25 Jun 2008 - 15:30:47 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive