[R] error: object of type 'closure' is not subsettable

robert.koellner robert.koellner at email.de
Thu Mar 14 12:08:50 CET 2013


Hi all,

when i run this script:
>read.table("Angelika.txt",header=T,sep="\t")
>mytable=read.table("Angelika.txt",header=T,sep="\t")
>for ( dye in c("A","B","C","F","G","K","L","M"))
+      {
+      for (cond in 1:8)
+          {
+          measurement = table[mytable[,"bed"]==cond &
mytable[,"dye"]==dye,"differenz"]
+          print(median(measurement)) 
+          wilcox.test(measurement,mu=0)
+          }
+       }
I get the error massage:
error in table[mytable[, "bed"] == cond & mytable[, "dye"] == dye,
"differenz"] :
object of type 'closure' is not subsettable

I am beginner with R, so I didn´t write this script myself. What is meant
with 'closure' and how can I solve this?

I started also another script (this time by myself) but for sure it is much
more work to do this in comparison to the other script:

#   con (condition)
#1: Standart-hoch
#2: Standart-niedrig
#3: Standart-mittel
#4: Ringe-hoch
#5: Ringe-niedrig
#6: Ringe-mittel
#7: Fitness-hoch
#8: Fitness-niedrig

#   dye
#A: Hoechst42
#B: Hoechst80
#C: Vio
#D: Vibrant Orange gating 1
#E: Vibrant Orange gating 2
#F: NID APC
#G: NID PerCP
#H: DraQ
#I: Syber Green 1000
#J: Syber Green 2000
#K: Syber Green 5000
#L: Acridin Orange FITC
#M: Acridin Orange PerCP

#Standart Hoch &  Hoechst42, Hoechst80, Vio, NID APC, NID PerCP, Syber Green
5000, Acridin Orange FITC, Acridin Orange PerCP        
aa=mytable[mytable[,"con"]==1& mytable[,"dye"]=="A","differenz"]
ab=mytable[mytable[,"con"]==1& mytable[,"dye"]=="B","differenz"]
ac=mytable[mytable[,"con"]==1& mytable[,"dye"]=="C","differenz"]
ad=mytable[mytable[,"con"]==1& mytable[,"dye"]=="F","differenz"]
ae=mytable[mytable[,"con"]==1& mytable[,"dye"]=="G","differenz"]
af=mytable[mytable[,"con"]==1& mytable[,"dye"]=="K","differenz"]
ag=mytable[mytable[,"con"]==1& mytable[,"dye"]=="L","differenz"]
ah=mytable[mytable[,"con"]==1& mytable[,"dye"]=="M","differenz"]
wilcox.test(aa,mu=0)
wilcox.test(ab,mu=0)...

but here I have to do a single test for each condition and dye...and thats
is much (each condition has to be tested with these dyes)

Table with data attached:
Angelika.txt <http://r.789695.n4.nabble.com/file/n4661305/Angelika.txt>  

It would be great if someone could help me.

Thanks and greetings

Robert



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



More information about the R-help mailing list