igraph

No package called igraph0 R

…衆ロ難τιáo~ 提交于 2019-12-20 06:27:28
问题 I'm trying to use "gspan" algorithm using R. I installed and loaded igraph . But when I call "gspan", I get this error: > results = subdue(graph1); Error in library(igraph0) : there is no package called ‘igraph0’ Could any one give me a solution, thanks in advance. 回答1: From the CRAN repo: Package ‘igraph0’ was removed from the CRAN repository. Formerly available versions can be obtained from the archive. This was a transitional package from Mar 2012 to Sept 2013. Packages depending on it

VisNetwork from IGraph - Can't Implement Cluster Colors to Vertices

醉酒当歌 提交于 2019-12-20 04:18:53
问题 I am starting to use the package called visNetwork and I feel like it has a ton of potential for User-Interface use in the future. There are few things that I am having trouble with though. I have created an igraph and have also applied a clustering algorithm to that specifically the fastgreedy algorithm. Example Code Provided: B = matrix( c(1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 47, 3, 0, 3, 0, 1, 10, 13, 5, 0, 3, 19, 0, 1, 0, 1, 7, 3, 1, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 3, 1, 0, 32, 0, 0, 3, 2, 1

resizing window and setting margins for minimum

和自甴很熟 提交于 2019-12-19 08:56:44
问题 I'm trying to create a tree graph, and since the "father" has a lot of "children" I'd like it to be a very wide graph. Therefore, I tried to resize the window with the windows option and set margins to zero width in order to have a wide graph. These are my program lines: windows(heigth=7, width=14, record=TRUE, rescale="fit") par(mar=c(1,0,1,0), omi=c(0,0,0,0), oma=c(0,0,0,0)) plot(graph_name,layout=layout.reingold.tilford(tree)) I get a wide device window but the plot is in the middle and

How to spread out community graph made by using igraph package in R

北慕城南 提交于 2019-12-19 05:47:20
问题 Trying to find communities in tweet data. The cosine similarity between different words forms the adjacency matrix. Then, I created graph out of that adjacency matrix. Visualization of the graph is the task here: # Document Term Matrix dtm = DocumentTermMatrix(tweets) ### adjust threshold here dtms = removeSparseTerms(dtm, 0.998) dim(dtms) # cosine similarity matrix t = as.matrix(dtms) # comparing two word feature vectors #cosine(t[,"yesterday"], t[,"yet"]) numWords = dim(t)[2] # cosine

Minimum Cost Flow - network optimization in R

℡╲_俬逩灬. 提交于 2019-12-19 04:04:16
问题 I am trying to implement a "Minimum Cost Network Flow" transportation problem solution in R . I understand that this could be implemented from scratch using something like lpSolve . However, I see that there is a convenient igraph implementation for "Maximum Flow". Such a pre-existing solution would be a lot more convenient, but I can't find an equivalent function for Minimum Cost. Is there an igraph function that calculates Minimum Cost Network Flow solutions, or is there a way to apply the

R igraph convert parallel edges to weight attribute

天大地大妈咪最大 提交于 2019-12-18 19:08:44
问题 I'm working with igraph for R. My graph is based on an edgelist which includes parallel edges (more than one edge with the same source and target). I would like to convert these parallel edges to an edge attribute weight. Is there an eay way to do this? If there is no easy way. how can I identify these parallel edges? duplicated(E(net)) does not return a single duplicate. I suppose its looking for duplicated edge ids. 回答1: You can also use E(graph)$weight <- 1 followed by simplify(graph, edge

Overlapping community detection with igraph or other libaries

。_饼干妹妹 提交于 2019-12-18 17:55:15
问题 I would like to detect overlapping communities in small networks/graphs. By overlapping, I mean that a node can be included within more than one communities/clusters in the output of the detection algorithm. I have looked at various community detection algorithms curretly provided by igraph , but I think none of them handles overlapping communities. Ideally, I would like to be able to programmatically utilize some implementation of such algorithm(s) in Python. However, implementation in other

Visualize Parse Tree Structure

萝らか妹 提交于 2019-12-18 16:46:08
问题 I would like to display the parsing (POS tagging) from openNLP as a tree structure visualization. Below I provide the parse tree from openNLP but I can not plot as a visual tree common to Python's parsing. install.packages( "http://datacube.wu.ac.at/src/contrib/openNLPmodels.en_1.5-1.tar.gz", repos=NULL, type="source" ) library(NLP) library(openNLP) x <- 'Scroll bar does not work the best either.' s <- as.String(x) ## Annotators sent_token_annotator <- Maxent_Sent_Token_Annotator() word_token

R package that links to external C library

一笑奈何 提交于 2019-12-18 14:19:33
问题 I have some c code that utilizes the igraph library. I would like to put an R wrapper around it and send it off to CRAN as an R package. igraph already has an R port on CRAN, so it would make sense for my R package 'foo' to depend on R's igraph. Since foo uses its own C code that depends on the C igraph, how can I link my C functions to the original igraph library? I've read that this is done in a file called Makevars, but linking to an external library is very hairy. If this isn't possible,

How to plot a bipartite graph in R

≡放荡痞女 提交于 2019-12-18 12:36:08
问题 How do I plot a network of type bipartite in R? Similar to this: I have similar data but with weights for both genes and diseases and SARS. This network is an example. I have different kind of attributes. I followed a link here. But due to my little knowledge in this topic, I could not get much out of it. Thanks in advance for any help. 回答1: From the ?bipartite_graph help: Bipartite graphs have a type vertex attribute in igraph, this is boolean and FALSE for the vertices of the first kind and