37

I am running R version 3.0.1 in a 64 bit OS, and I have tried to install Rgraphviz 3 different ways:

1) I have used install.packages(Rgraphviz), but I get the error

Error in install.packages(Rgraphviz) : object 'Rgraphviz' not found

2) I have tried going through Packages > Install Packages in the R window, but I cannot find Rgraphviz

3) When I go through CRAN, at http://cran.r-project.org/web/packages/Rgraphviz/index.html, I get the message "Package ‘Rgraphviz’ was removed from the CRAN repository."

Does anyone know if there is any way I can get Rgraphviz, or if there is a suitable alternate?

2 Answers2

86

You need to install it directly from the bioconductors site.

For R versions >= 3.5:

install.packages("BiocManager")
BiocManager::install("Rgraphviz")

For older R versions:

source("http://bioconductor.org/biocLite.R")
biocLite("Rgraphviz")

More info can be found here.

normanius
  • 8,629
  • 7
  • 53
  • 83
Michael Malick
  • 1,838
  • 12
  • 6
  • 1
    I tried that, but when I tried using `graphviz.plot(x)` I got an error that it could not find the function –  Aug 02 '13 at 18:14
  • 4
    The `graphviz.plot()` function is not in the Rgraphviz package, it is in the bnlearn package and depends on the Rgraphviz package. So you also need to load the bnlearn package: `library(bnlearn)` – Michael Malick Aug 02 '13 at 18:26
  • 1
    Do you have the bnlearn package installed? `install.packages("bnlearn")` – Michael Malick Aug 02 '13 at 18:33
  • I am getting error `Error in plot(agread(ff)) : could not find function "agread"` while executing `plot(agread(ff))`. Is there any solution? – kravi Jun 26 '15 at 09:32
  • 1
    In my case it work, but the labels are so tiny that I cannot see the words inside them. What could I do? – aloplop85 Sep 19 '15 at 08:29
  • Beautiful. Thank you – Raghavan vmvs Jan 04 '22 at 11:48
-5

You just need to remember that the instruction install.packages requires you to enclose the package name between quotes, like this:

install.packages("Rgraphviz")
Martin Evans
  • 45,791
  • 17
  • 81
  • 97
Werner
  • 1
  • 1
    Though true that quotes are required, since Rgraphviz was removed from the CRAN repo this will not work. Must source it differently as outlined by answer above. – kay Jul 21 '17 at 18:40