[R] error: Error in if (any(DF[A, ] != DF[B, ])) { : missing value where TRUE/FALSE needed

Eric Berger er|cjberger @end|ng |rom gm@||@com
Sun Apr 5 06:25:34 CEST 2020


Hi Orlando,
This is not a reproducible example because of the line
MyGraphData <- read.graph ( file = "0.edges" , directed = FALSE )
We don't have the file   "0.edges" .

But here's an example that reproduces the error message. Maybe it will help
you find your problem.

DF <- data.frame( x=NA, y=5 )
if ( any( DF[1,] != DF[2,]) ) cat("hello world\n")

#  Error in if ( any( DF[1,] != DF[2,]) ) cat("hello world\n") :
#     missing value where TRUE/FALSE needed

HTH,
Eric


On Sat, Apr 4, 2020 at 11:10 PM Orlando Ramirez via R-help <
r-help using r-project.org> wrote:

> Hello this is my code and then i show you the result...please how i reapir
> this error...thanks lot off
> library(igraph)
> #################################################
> # Lecture du fichier 0. edges
> MyGraphData <- read.graph ( file = "0.edges" , directed = FALSE )
> # Nombre de noeuds dans le graphe
> Nb_noeuds <- vcount ( MyGraphData )
> Nb_noeuds
> # [1] 348
> # Pour enlever les doublons et les boucles dans le graphe
> MyGraphData <- simplify ( MyGraphData , remove.multiple = TRUE ,
> remove.loops = TRUE )
> # Nombre d ' arrêtes dans le graphe
> Nb_arretes <- ecount ( MyGraphData )
> Nb_arretes
> # [1] 2519
> # Structure hiérarchique des noeuds
> cluster <- edge.betweenness.community ( MyGraphData )
> cluster
> # > cluster
> # # les noeuds dans chaque communauté
> # IGRAPH clustering edge betweenness, groups: 51, mod: 0.42
> # + groups:
> #   $`1`
> # [1] 1
> #
> # $`2`
> # [1]   2  25  49  54  58  74  81  93  95 102 127 131 181 188 192 195 197
> 205 243 250 255 267 300
> # [24] 301 303 331 347
> #
> # $`3`
> # [1]   3  15  18  20  21  29  33  42  45  94 112 113 116 117 138 139 141
> 145 150 152 163 168 175
> # [24] 215 217 221 227 244 263 280 290 294 306 311 313 327 334 338 344
> # + ... omitted several groups/vertices
> # fc <- cluster_fast_greedy(MyGraphData)
> #  plot_dendrogram(fc)
> # Visualisation
> plot_dendrogram (cluster  )
> Error in if (any(DF[A, ] != DF[B, ])) { :
>   missing value where TRUE/FALSE needed
>
>
>
>                                        Â
>>         [[alternative HTML version deleted]]
>
> ______________________________________________
> R-help using r-project.org mailing list -- To UNSUBSCRIBE and more, see
> 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.
>

	[[alternative HTML version deleted]]



More information about the R-help mailing list