[R] How to build a package which loads Rgraphviz (if installed)...

From: Søren Højsgaard <Soren.Hojsgaard_at_agrsci.dk>
Date: Sat, 12 Jul 2008 22:23:20 +0200


Dear List,
I use Rgraphviz for display of graphs in some packages. Since Rgraphviz is no longer on CRAN it needs to be installed from Bioconductor and that is fine, but I have trouble figureing out the following: I create a plot method which - if Rgraphviz is installed - uses Rgraphviz for displaying and otherwise does nothing. This is implemented as:    

  if (!("package:Rgraphviz" %in% search())){     if("Rgraphviz" %in% installed.packages()){       require(Rgraphviz)
    } else {

      cat("The Rgraphviz package (from Bioconductor) must be installed to display the models\n")
      return()

    }
  }
 ... else go on and do the plotting...  

When I run rcmd check packagename (on Windows XP, using R.2.7.1) I get  

I can not state Rgraphviz in the Depends-field of the DESCRIPTION file because then the package does not pass the windows checks for going on CRAN. I can not see any solution from "writing R extensions", but I apologize if I have overlooked it. Does anyone have a suggestion on what to do?  

Cheers
Søren    



R-help_at_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. Received on Sat 12 Jul 2008 - 20:27:55 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Sat 12 Jul 2008 - 22:31:30 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive