igraph-help
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [igraph] igraph in R/Rscript error


From: Tamas Nepusz
Subject: Re: [igraph] igraph in R/Rscript error
Date: Mon, 26 Oct 2009 09:34:14 +0000
User-agent: Mutt/1.5.17 (2007-11-01)

Hi Michael,

Rscript does not load all the packages that R loads at startup by
default. In particular, the "methods" package is not loaded by default
since it takes about 60% of the startup time [1]. The "is" function is
defined in the "methods" package, so you'll have to load that:

$ Rscript --default-packages=methods test.R

Another possibility is to set the R_DEFAULT_PACKAGES environment
variable:

$ export R_DEFAULT_PACKAGES=methods
$ Rscript test.R

[1] http://finzi.psych.upenn.edu/R/library/utils/html/Rscript.html

Best,
-- 
Tamas


On Sun, Oct 25, 2009 at 10:16:57PM -0400, Michael Krein wrote:
> Hello community!
>
> I have (hopefully) a very simple question to you all, but it's leaving me 
> very frustrated here.  :-P
>
> I'm trying to call igraph from an Rscript, and the error is as follows:
> --
> Error in graph.adjacency(c, mode = "undirected", diag = FALSE) :
>  could not find function "is"
> Execution halted
> --
>
> Below is the sample code, which executes fine from the interactive R 
> session:
> --
> library(igraph)
>
> a<-c(1,2,3,4,5,6,7,8,9)
> dim(a) <- c(3,3)
>
> b <- as.matrix(dist(a))
> c <- (b < 2)
>
> d<-graph.adjacency(c, mode="undirected", diag=FALSE)
> print(transitivity(d))
> --
>
> And gives me the transitivity/cluster coefficient of 0, which is expected.
>
>
> I'm using R version 2.9.2 (2009-08-24) for x86-64, on CentOS 5.4 (I'm using 
> the R version from the EPEL repository.)
> I installed igraph via install.packages("igraph", dependencies=TRUE) today, 
> so I believe I am using the current version.
>
>
> Any help would be much appreciated.
>
> Thanks!
> -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
> Michael Krein
> Breneman Research Group
> Rensselaer Exploratory Center for Cheminformatics Research
> Rensselaer Polytechnic Institute
> -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
>
>
>
>
>
>
> _______________________________________________
> igraph-help mailing list
> address@hidden
> http://lists.nongnu.org/mailman/listinfo/igraph-help




reply via email to

[Prev in Thread] Current Thread [Next in Thread]