I define a class which has a dataframe slot, df, which is accessed by method doAnalysis.
setClass(Class='E166Hist',representation=representation(df='data.frame'), contains='ImmutableAnalysis')
setGeneric(name='doAnalysis', def=function(x){standardGeneric('doAnalysis')})
setMethod(f='doAnalysis', signature='E166Hist', definition=function(x){
tmp<-melt(x@df, variable.name='source', value.name='pc')})
When I call
dh<-new(Class='E166Hist')
doAnalysis(dh)
I get Error in varnames[discrete] : invalid subscript type 'list' which seems to be caused by x@df. It works ok if I replace x@df with just df. I'm confused because I thought the @ was needed to access the slots of a class. If anyone could explain what I'm missing here I'd appreciate it. Thanks!