1

Code as,

setClass("tst",representation(mat="matrix", Distmat="dist"))

When building it, there is a warning as,

Warning: undefined slot classes in definition of “tst”: Distmat(class “dist”)

How to make the class of slot Distmat as dist?

Update The answer is as Martin's comment

Update2: When BiocCheck this package. it appears:

the specification for S3 class “dist” in package ‘tst’ seems equivalent to   
one from package ‘graph : not turning on duplicate class definitions for this
class.

It seems setOldClass is not recommended if an object exists in an S4 Class. Any solution?

Martin Morgan
  • 45,935
  • 7
  • 84
  • 112
Zhilong Jia
  • 2,329
  • 1
  • 22
  • 34
  • 'dist' is an S3 class; use [setOldClass](http://stackoverflow.com/questions/9067492/example-of-using-an-s3-class-in-a-s4-object) – Martin Morgan Dec 19 '14 at 15:18
  • The message is from installing or loading the package. Your question is too complicated to reproduce (the package source is not available in the question), so I can't provide detailed answers. setOldClass() should be used; perhaps a package you are using already has setOldClass(), and it is not necessary for you to do so; perhaps another package and graph both use setOldClass("dist"), and it will be difficult to get rid of the second warning. If developing a package for BIocondcutor, ask on the bioc-devel [mailing list](http://bioconductor.org/help/support/#bioc-devel). – Martin Morgan Apr 01 '15 at 21:20
  • @MartinMorgan, Yes, it will be a Bioconductor package (https://github.com/zhilongjia/cogena), I will ask on bioc-devel mailing list. Thank you. – Zhilong Jia Apr 01 '15 at 22:03

0 Answers0