"boxplot" is a function ("closure"). You probably meant "bungoma_boxplot$Month"?
Please read the Posting Guide. One point it mentions is that this is a plain text mailing list... HTML format email is not a what-you-see-is-what-we-see format. --------------------------------------------------------------------------- Jeff Newmiller The ..... ..... Go Live... DCN:<jdnew...@dcn.davis.ca.us> Basics: ##.#. ##.#. Live Go... Live: OO#.. Dead: OO#.. Playing Research Engineer (Solar/Batteries O.O#. #.O#. with /Software/Embedded Controllers) .OO#. .OO#. rocks...1k --------------------------------------------------------------------------- Sent from my phone. Please excuse my brevity. On August 5, 2014 4:33:33 AM PDT, Frederic Ntirenganya <ntfr...@gmail.com> wrote: >Dear All, > >I am getting this error: Error in boxplot$Month : object of type >'closure' >is not subsettable > >The following is the codes i am using to produce the boxplot I need for >this daily rainfall data. > >## reading the data >rm(list=ls(all=TRUE)) >Bungoma=read.csv("/home/fredo/Documents/Maseno/Data/Bungoma_2.csv") >attach(Bungoma) >head(Bungoma) >tail(Bungoma) >summary(Bungoma) ># removing missing values >Bungoma <- na.omit(Bungoma) >summary(Bungoma) >###### split the data by month and boxplot for 0.85mm as the threshold >box_plot=Bungoma[Bungoma$Rain>0.85,] >head(box_plot) >bungoma_boxplot=split(box_plot$Rain,box_plot$Month) >head(bungoma_boxplot) >boxplot(bungoma_boxplot, >names=c("J","F","M","A","M","J","J","A","S","O","N","D"),width = >table(boxplot$Month)) >title(main="Boxplot of Rain for each month") > >Any idea is welcome on how I can make it and overcome the error. >Thanks. > > [[alternative HTML version deleted]] > >______________________________________________ >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. ______________________________________________ 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.