[R] R problem: Error in data[2:4] : object of type 'closure' is not subsettable

andrepavlik avi5032 at psu.edu
Thu Dec 12 05:50:56 CET 2013


Human_Rights_Excel_Data.xlsx
<http://r.789695.n4.nabble.com/file/n4682042/Human_Rights_Excel_Data.xlsx>  

Above is the attachment for my excel data. 

I am having this problem: Error in data[2:4] : object of type 'closure' is
not subsettable

Here is my code
#data<-readcsv("HumanRightsExcelData")
par(mar=c(5,22,4,0.2))
COLOR<-c('red','brown4','black')
barplot(log10(t(as.matrix(data[,2:4]))),beside=T,horiz=T,las=2,names.arg=t(data$X),col=COLOR,main='KilingsinGaza,\nWestBank,andIsrael',xlab='Base10totheNnumberofKillings')
par(new=T,mar=c(0,0,0,0))
plot(0,0,type="n")
legend("bottomleft",legend=c("Gaza","West
Bank","Israel"),text.col=COLOR,bty="n",cex=1.5)

When ever I type in this code

barplot(log10(t(as.matrix(data[,2:4]))),beside=T,horiz=T,las=2,names.arg=t(data$X),col=COLOR,main='KilingsinGaza,\nWestBank,andIsrael',xlab='Base10totheNnumberofKillings')

I get this message

Error in data[2:4] : object of type 'closure' is not subsettable

Can someone please help me out? Also I am terrible with R so please try and
make your responses idiot proof hahahaha. 



--
View this message in context: http://r.789695.n4.nabble.com/R-problem-Error-in-data-2-4-object-of-type-closure-is-not-subsettable-tp4682042.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list