igraph-help
[Top][All Lists]
Advanced

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

Re: [igraph] Possible bug in degree.distribution for R v3.0.0 and above


From: Tamás Nepusz
Subject: Re: [igraph] Possible bug in degree.distribution for R v3.0.0 and above
Date: Tue, 3 Sep 2013 21:45:41 +0200

Dear Fabio,

Thanks for the report; this has already been fixed in the development version 
and the fix will be included in the next release:

https://github.com/igraph/igraph/issues/257

All the best,
Tamas

On 3 Sep 2013, at 20:15, Fabio Daolio <address@hidden> wrote:

> Dear all,
> 
> I'm not familiar with bug reporting and tracking, thus my apologies for 
> spamming the help-list.
> Anyway, I noticed that the "degree.distribution" function returns "NULL" 
> under R v3.0.1.
> 
> I think this might be due to the fact that the "hist" function, which is 
> called, returns an object
> that doesn't have an "intensity" component anymore (since R 3.0.0).
> Could that be?
> 
> A temporary fix might be to define your own function:
> degree.distribution<-function (graph, cumulative = FALSE, ...) 
> {
>    if (!is.igraph(graph)) {
>        stop("Not a graph object")
>    }
>    cs <- degree(graph, ...)
>    hi <- hist(cs, -1:max(cs), plot = FALSE)$density
>    if (!cumulative) {
>        res <- hi
>    }
>    else {
>        res <- rev(cumsum(rev(hi)))
>    }
>    res
> } 
> 
> Cheers,
> --
> Fabio
> _______________________________________________
> igraph-help mailing list
> address@hidden
> https://lists.nongnu.org/mailman/listinfo/igraph-help




reply via email to

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