Rgraphviz: fail to plot
3
0
Entering edit mode
Guest User ★ 13k
@guest-user-4897
Last seen 9.6 years ago
I upgraded Rgraphviz, and now it fails to plot even the first example, > set.seed(123) > V <- letters[1:10] > M <- 1:4 > g1 <- randomGraph(V, M, 0.2) > plot(g1) Error in as.double(y) : cannot coerce type 'S4' to vector of type 'double' seems like no 'plot method' is defined for the graph; but this sounds like something else is going on. Anyone with a similar problem? Best H -- output of sessionInfo(): $ R --vanilla R version 2.14.1 (2011-12-22) Copyright (C) 2011 The R Foundation for Statistical Computing ISBN 3-900051-07-0 Platform: x86_64-redhat-linux-gnu (64-bit) R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details. Natural language support but running in an English locale R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications. Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for an HTML browser interface to help. Type 'q()' to quit R. > library(Rgraphviz) Loading required package: graph Loading required package: grid > set.seed(123) > V <- letters[1:10] > M <- 1:4 > > > ################################################### > ### code chunk number 2: createGraph2 > ################################################### > g1 <- randomGraph(V, M, 0.2) > plot(g1) Error in as.double(y) : cannot coerce type 'S4' to vector of type 'double' > sessionInfo() R version 2.14.1 (2011-12-22) Platform: x86_64-redhat-linux-gnu (64-bit) locale: [1] LC_CTYPE=en_GB.utf8 LC_NUMERIC=C [3] LC_TIME=en_DK.utf8 LC_COLLATE=en_GB.utf8 [5] LC_MONETARY=en_GB.utf8 LC_MESSAGES=en_GB.utf8 [7] LC_PAPER=C LC_NAME=C [9] LC_ADDRESS=C LC_TELEPHONE=C [11] LC_MEASUREMENT=en_GB.utf8 LC_IDENTIFICATION=C attached base packages: [1] grid stats graphics grDevices utils datasets methods [8] base other attached packages: [1] Rgraphviz_1.32.0 graph_1.32.0 loaded via a namespace (and not attached): [1] lattice_0.20-0 Matrix_1.0-2 pixmap_0.4-11 sp_0.9-91 tools_2.14.1 > -- Sent via the guest posting facility at bioconductor.org.
Rgraphviz Rgraphviz • 3.1k views
ADD COMMENT
0
Entering edit mode
Dan Tenenbaum ★ 8.2k
@dan-tenenbaum-4256
Last seen 3.2 years ago
United States
Hi H?vard, 2012/1/25 H?vard Rue [guest] <guest at="" bioconductor.org="">: > > I upgraded Rgraphviz, and now it fails to plot even the first example, > >> set.seed(123) >> V <- letters[1:10] >> M <- 1:4 >> g1 <- randomGraph(V, M, 0.2) >> plot(g1) > Error in as.double(y) : > ?cannot coerce type 'S4' to vector of type 'double' > > seems like no 'plot method' is defined for the graph; but this sounds like something else is going on. > > Anyone with a similar problem? > > Best > H > > ?-- output of sessionInfo(): > > $ R --vanilla > > R version 2.14.1 (2011-12-22) > Copyright (C) 2011 The R Foundation for Statistical Computing > ISBN 3-900051-07-0 > Platform: x86_64-redhat-linux-gnu (64-bit) > > R is free software and comes with ABSOLUTELY NO WARRANTY. > You are welcome to redistribute it under certain conditions. > Type 'license()' or 'licence()' for distribution details. > > ?Natural language support but running in an English locale > > R is a collaborative project with many contributors. > Type 'contributors()' for more information and > 'citation()' on how to cite R or R packages in publications. > > Type 'demo()' for some demos, 'help()' for on-line help, or > 'help.start()' for an HTML browser interface to help. > Type 'q()' to quit R. > >> library(Rgraphviz) > Loading required package: graph > Loading required package: grid >> set.seed(123) >> V <- letters[1:10] >> M <- 1:4 >> >> >> ################################################### >> ### code chunk number 2: createGraph2 >> ################################################### >> g1 <- randomGraph(V, M, 0.2) >> plot(g1) > Error in as.double(y) : > ?cannot coerce type 'S4' to vector of type 'double' >> sessionInfo() > R version 2.14.1 (2011-12-22) > Platform: x86_64-redhat-linux-gnu (64-bit) > > locale: > ?[1] LC_CTYPE=en_GB.utf8 ? ? ? LC_NUMERIC=C > ?[3] LC_TIME=en_DK.utf8 ? ? ? ?LC_COLLATE=en_GB.utf8 > ?[5] LC_MONETARY=en_GB.utf8 ? ?LC_MESSAGES=en_GB.utf8 > ?[7] LC_PAPER=C ? ? ? ? ? ? ? ?LC_NAME=C > ?[9] LC_ADDRESS=C ? ? ? ? ? ? ?LC_TELEPHONE=C > [11] LC_MEASUREMENT=en_GB.utf8 LC_IDENTIFICATION=C > > attached base packages: > [1] grid ? ? ?stats ? ? graphics ?grDevices utils ? ? datasets ?methods > [8] base > > other attached packages: > [1] Rgraphviz_1.32.0 graph_1.32.0 > > loaded via a namespace (and not attached): > [1] lattice_0.20-0 Matrix_1.0-2 ? pixmap_0.4-11 ?sp_0.9-91 ? ? ?tools_2.14.1 >> > Not sure what is going on here. What does capabilities() report? It's always a good idea to make sure all your packages are up to date as follows: source("http://bioconductor.org/biocLite.R") biocLite(character(), ask=FALSE) Try that and let us know if your results change. Dan > > -- > Sent via the guest posting facility at bioconductor.org. > > _______________________________________________ > Bioconductor mailing list > Bioconductor at r-project.org > https://stat.ethz.ch/mailman/listinfo/bioconductor > Search the archives: http://news.gmane.org/gmane.science.biology.informatics.conductor
ADD COMMENT
0
Entering edit mode
Dan Tenenbaum ★ 8.2k
@dan-tenenbaum-4256
Last seen 3.2 years ago
United States
On Thu, Jan 26, 2012 at 9:53 AM, H?vard Rue <hrue at="" math.ntnu.no=""> wrote: > On Wed, 2012-01-25 at 15:08 -0800, Dan Tenenbaum wrote: > >> Are you still having the problem with Rgraphviz? >> I'm not sure what to tell you. Did you upgrade anything else besides >> Rgraphviz (such as R itself)? Any difference in how you are running R >> (for example, are you ssh'd in or are you right at the machine?). > > > this stopped working some months ago, and I have upgraded my system to > Fedora 16 inbetween. Did it stop working before or after the OS upgrade? > > to me it seems that it does not know that > >> class(g1) > [1] "graphNEL" > attr(,"package") > [1] "graph" > > > objects, as a spesific plot-function in Rgraphviz. > > I'm not very very into classes/methods, so I might be wrong. > > The debug(plot) shows what is going on, I think: > > > $ R --vanilla > > R version 2.14.1 (2011-12-22) > Copyright (C) 2011 The R Foundation for Statistical Computing > ISBN 3-900051-07-0 > Platform: x86_64-redhat-linux-gnu (64-bit) > > R is free software and comes with ABSOLUTELY NO WARRANTY. > You are welcome to redistribute it under certain conditions. > Type 'license()' or 'licence()' for distribution details. > > ?Natural language support but running in an English locale > > R is a collaborative project with many contributors. > Type 'contributors()' for more information and > 'citation()' on how to cite R or R packages in publications. > > Type 'demo()' for some demos, 'help()' for on-line help, or > 'help.start()' for an HTML browser interface to help. > Type 'q()' to quit R. > >> library(Rgraphviz) > Loading required package: graph > Loading required package: grid >> V <- letters[1:10] >> M <- 1:4 >> g1 <- randomGraph(V, M, 0.2) >> methods("plot") > ?[1] plot.acf* ? ? ? ? ? plot.data.frame* ? ?plot.decomposed.ts* > ?[4] plot.default ? ? ? ?plot.dendrogram* ? ?plot.density > ?[7] plot.ecdf ? ? ? ? ? plot.factor* ? ? ? ?plot.formula* > [10] plot.function ? ? ? plot.hclust* ? ? ? ?plot.histogram* > [13] plot.HoltWinters* ? plot.isoreg* ? ? ? ?plot.lm > [16] plot.medpolish* ? ? plot.mlm ? ? ? ? ? ?plot.ppr* > [19] plot.prcomp* ? ? ? ?plot.princomp* ? ? ?plot.profile.nls* > [22] plot.shingle* ? ? ? plot.spec ? ? ? ? ? plot.stepfun > [25] plot.stl* ? ? ? ? ? plot.table* ? ? ? ? plot.trellis* > [28] plot.ts ? ? ? ? ? ? plot.tskernel* ? ? ?plot.TukeyHSD > > ? Non-visible functions are asterisked >> debug(plot) >> plot(g1) > debugging in: plot(g1) > debug: UseMethod("plot") > Browse[2]> n > debugging in: plot.default(g1) > debug: { > ? ?localAxis <- function(..., col, bg, pch, cex, lty, lwd) Axis(...) > ? ?localBox <- function(..., col, bg, pch, cex, lty, lwd) box(...) > ? ?localWindow <- function(..., col, bg, pch, cex, lty, lwd) > plot.window(...) > ? ?localTitle <- function(..., col, bg, pch, cex, lty, lwd) title(...) > ? ?xlabel <- if (!missing(x)) > ? ? ? ?deparse(substitute(x)) > ? ?ylabel <- if (!missing(y)) > ? ? ? ?deparse(substitute(y)) > > I'm not sure what to make of this. Perhaps someone else on the list (or the package maintainer, CC'd) can help. Dan > > Best > H > > > > > -- > H?vard Rue > Department of Mathematical Sciences > Norwegian University of Science and Technology > N-7491 Trondheim, Norway > Voice: ?+47-7359-3533 ? ?URL ?: http://www.math.ntnu.no/~hrue > Mobile: +47-9260-0021 ? ?Email: havard.rue at math.ntnu.no > > Upcoming workshop on latent Gaussian models: lgm2012.r-inla.org >
ADD COMMENT
0
Entering edit mode
@martin-morgan-1513
Last seen 5 days ago
United States
On 01/25/2012 10:30 AM, H??vard Rue [guest] wrote: > > I upgraded Rgraphviz, and now it fails to plot even the first example, > >> set.seed(123) >> V<- letters[1:10] >> M<- 1:4 >> g1<- randomGraph(V, M, 0.2) >> plot(g1) > Error in as.double(y) : > cannot coerce type 'S4' to vector of type 'double' > > seems like no 'plot method' is defined for the graph; but this sounds like something else is going on. > > Anyone with a similar problem? > > Best > H > > -- output of sessionInfo(): > > $ R --vanilla > > R version 2.14.1 (2011-12-22) > Copyright (C) 2011 The R Foundation for Statistical Computing > ISBN 3-900051-07-0 > Platform: x86_64-redhat-linux-gnu (64-bit) > > R is free software and comes with ABSOLUTELY NO WARRANTY. > You are welcome to redistribute it under certain conditions. > Type 'license()' or 'licence()' for distribution details. > > Natural language support but running in an English locale > > R is a collaborative project with many contributors. > Type 'contributors()' for more information and > 'citation()' on how to cite R or R packages in publications. > > Type 'demo()' for some demos, 'help()' for on-line help, or > 'help.start()' for an HTML browser interface to help. > Type 'q()' to quit R. > >> library(Rgraphviz) > Loading required package: graph > Loading required package: grid >> set.seed(123) >> V<- letters[1:10] >> M<- 1:4 >> >> >> ################################################### >> ### code chunk number 2: createGraph2 >> ################################################### >> g1<- randomGraph(V, M, 0.2) >> plot(g1) > Error in as.double(y) : > cannot coerce type 'S4' to vector of type 'double' >> sessionInfo() > R version 2.14.1 (2011-12-22) > Platform: x86_64-redhat-linux-gnu (64-bit) > > locale: > [1] LC_CTYPE=en_GB.utf8 LC_NUMERIC=C > [3] LC_TIME=en_DK.utf8 LC_COLLATE=en_GB.utf8 > [5] LC_MONETARY=en_GB.utf8 LC_MESSAGES=en_GB.utf8 > [7] LC_PAPER=C LC_NAME=C > [9] LC_ADDRESS=C LC_TELEPHONE=C > [11] LC_MEASUREMENT=en_GB.utf8 LC_IDENTIFICATION=C > > attached base packages: > [1] grid stats graphics grDevices utils datasets methods > [8] base > > other attached packages: > [1] Rgraphviz_1.32.0 graph_1.32.0 > > loaded via a namespace (and not attached): > [1] lattice_0.20-0 Matrix_1.0-2 pixmap_0.4-11 sp_0.9-91 tools_2.14.1 This sessionInfo() isn't consistent with R --vanilla followed by library(Rgraphviz) -- lattice, Matrix, pixmap, sp would not be attached. You're right (in a subsequent message) that the problem looks like method dispatch; Rgraphviz::plot(g1) might get what you want but it would be good to have a complete and consistent script / sessionInfo to understand the problem. Martin >> > > > -- > Sent via the guest posting facility at bioconductor.org. > > _______________________________________________ > Bioconductor mailing list > Bioconductor at r-project.org > https://stat.ethz.ch/mailman/listinfo/bioconductor > Search the archives: http://news.gmane.org/gmane.science.biology.informatics.conductor -- Computational Biology Fred Hutchinson Cancer Research Center 1100 Fairview Ave. N. PO Box 19024 Seattle, WA 98109 Location: M1-B861 Telephone: 206 667-2793
ADD COMMENT
0
Entering edit mode
I removed my local library, and reinstalled everything. Problem solved ;-) thanks. H On Thu, 2012-01-26 at 12:23 -0800, Martin Morgan wrote: > On 01/25/2012 10:30 AM, H??vard Rue [guest] wrote: > > > > I upgraded Rgraphviz, and now it fails to plot even the first example, > > > >> set.seed(123) > >> V<- letters[1:10] > >> M<- 1:4 > >> g1<- randomGraph(V, M, 0.2) > >> plot(g1) > > Error in as.double(y) : > > cannot coerce type 'S4' to vector of type 'double' > > > > seems like no 'plot method' is defined for the graph; but this sounds like something else is going on. > > > > Anyone with a similar problem? > > > > Best > > H > > > > -- output of sessionInfo(): > > > > $ R --vanilla > > > > R version 2.14.1 (2011-12-22) > > Copyright (C) 2011 The R Foundation for Statistical Computing > > ISBN 3-900051-07-0 > > Platform: x86_64-redhat-linux-gnu (64-bit) > > > > R is free software and comes with ABSOLUTELY NO WARRANTY. > > You are welcome to redistribute it under certain conditions. > > Type 'license()' or 'licence()' for distribution details. > > > > Natural language support but running in an English locale > > > > R is a collaborative project with many contributors. > > Type 'contributors()' for more information and > > 'citation()' on how to cite R or R packages in publications. > > > > Type 'demo()' for some demos, 'help()' for on-line help, or > > 'help.start()' for an HTML browser interface to help. > > Type 'q()' to quit R. > > > >> library(Rgraphviz) > > Loading required package: graph > > Loading required package: grid > >> set.seed(123) > >> V<- letters[1:10] > >> M<- 1:4 > >> > >> > >> ################################################### > >> ### code chunk number 2: createGraph2 > >> ################################################### > >> g1<- randomGraph(V, M, 0.2) > >> plot(g1) > > Error in as.double(y) : > > cannot coerce type 'S4' to vector of type 'double' > >> sessionInfo() > > R version 2.14.1 (2011-12-22) > > Platform: x86_64-redhat-linux-gnu (64-bit) > > > > locale: > > [1] LC_CTYPE=en_GB.utf8 LC_NUMERIC=C > > [3] LC_TIME=en_DK.utf8 LC_COLLATE=en_GB.utf8 > > [5] LC_MONETARY=en_GB.utf8 LC_MESSAGES=en_GB.utf8 > > [7] LC_PAPER=C LC_NAME=C > > [9] LC_ADDRESS=C LC_TELEPHONE=C > > [11] LC_MEASUREMENT=en_GB.utf8 LC_IDENTIFICATION=C > > > > attached base packages: > > [1] grid stats graphics grDevices utils datasets methods > > [8] base > > > > other attached packages: > > [1] Rgraphviz_1.32.0 graph_1.32.0 > > > > loaded via a namespace (and not attached): > > [1] lattice_0.20-0 Matrix_1.0-2 pixmap_0.4-11 sp_0.9-91 tools_2.14.1 > > This sessionInfo() isn't consistent with R --vanilla followed by > library(Rgraphviz) -- lattice, Matrix, pixmap, sp would not be attached. > You're right (in a subsequent message) that the problem looks like > method dispatch; Rgraphviz::plot(g1) might get what you want but it > would be good to have a complete and consistent script / sessionInfo to > understand the problem. > > Martin > > >> > > > > > > -- > > Sent via the guest posting facility at bioconductor.org. > > > > _______________________________________________ > > Bioconductor mailing list > > Bioconductor at r-project.org > > https://stat.ethz.ch/mailman/listinfo/bioconductor > > Search the archives: http://news.gmane.org/gmane.science.biology.informatics.conductor > > b -- H?vard Rue Department of Mathematical Sciences Norwegian University of Science and Technology N-7491 Trondheim, Norway Voice: +47-7359-3533 URL : http://www.math.ntnu.no/~hrue Mobile: +47-9260-0021 Email: havard.rue at math.ntnu.no Upcoming workshop on latent Gaussian models: lgm2012.r-inla.org
ADD REPLY

Login before adding your answer.

Traffic: 679 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6