[R] create a network for a small text df
Jeff Newmiller
jdnewm|| @end|ng |rom dcn@d@v|@@c@@u@
Fri Feb 1 17:14:17 CET 2019
I an finding your question very opaque. For one thing, why aren't you specifying any edges? Since I don't do this kind of analysis normally I don't know what your combined graph should look like. Can you provide a link you what you hope to end up with?
Note that the Posting Guide emphasizes that the topic here is R... not the theory behind what specific packages or analyses require... so you need to be more explicit here than you have been so far.
On February 1, 2019 1:31:31 AM PST, Elahe chalabi via R-help <r-help using r-project.org> wrote:
>Thanks for your reply but it does not solve the problem. Since I have 7
>text rows in my df then I have to run something like
>net2=graph(c("account","block","block","solve","solve","problem")) for
>each, I'm looking for a way to bring all the relations in one single
>plot
>
>
>
>On Thursday, January 31, 2019 3:24 PM, Bill Poling
><Bill.Poling using zelis.com> wrote:
>
>
>
>Hello Elahe, this probably does not help but my idea may move you
>forward?
>
>
>################################################################# NEW
>TOPIC
>##############################################################################
>#From: R-help <r-help-bounces using r-project.org> On Behalf Of Elahe chalabi
>via R-help Sent: Wednesday, January 30, 2019 5:16 AM
>
># I ran this
>net1 <- structure(list(text = structure(c(1L, 7L, 3L, 4L, 5L, 6L, 2L),
>.Label = c("account block solv problem",
>"exactly problem morning", "investigate similar problem", "matched
>problem control vec", "problem also accour yesterday", "same problem jj
>", "same problem uk"
>), class = "factor")), class = "data.frame", row.names = c(NA,
>-7L))
>
>#And I ran this
>
>library(igraph)
>net2=graph(c("account","block","block","solve","solve","problem"))
>plot(net2)
>
># I do not get 7 plots, only one? See attached.
>
>WHP
>
>From: R-help <r-help-bounces using r-project.org> On Behalf Of Elahe chalabi
>via R-help
>Sent: Wednesday, January 30, 2019 5:16 AM
>To: R-help Mailing List <r-help using r-project.org>
>Subject: [R] create a network for a small text df
>
>Hi all,
>
>I have a small dataframe and I would like to show in a network plot how
>words are related to the word "problem" with arrows (keeping the order
>of the words in sentences).
>Here's the df:
>
>
>dput(df)
>structure(list(text = structure(c(1L, 7L, 3L, 4L, 5L, 6L, 2L), .Label =
>c("account block solv problem",
>"exactly problem morning", "investigate similar problem", "matched
>problem control vec", "problem also accour yesterday", "same problem jj
>", "same problem uk"
>), class = "factor")), class = "data.frame", row.names = c(NA,
>-7L))
>
>So far I have tried plotting each row a a network as following:
>
>
>
>library(igraph)
>net=graph(c("account","block","block","solve","solve","problem"))
>plot(net)
>
>but I will end up having 7 plots, is there a better way?
>thanks for any help.
>Elahe.
>
>______________________________________________
>mailto: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.
>
>Confidentiality Notice This message is sent from Zelis.
>...{{dropped:7}}
>
>______________________________________________
>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.
--
Sent from my phone. Please excuse my brevity.
More information about the R-help
mailing list