GraphTweets

Build Status Build status codecov.io Coverage Status CRAN_Status_Badge CRAN log twinetverse

Visualise networks of Twitter interactions.

library(htmltools)

div(
  class = "row",
  div(
    class = "col-md-3",
    img(
      src = "logo.png",
      alt = "graphTweets",
      style = "max-height:280px;margin-right:3%;",
      align = "left"
    )
  ),
  div(
    class = "col-md-9",
    div(
      class = "row",
      div(
        class = "col-md-3",
        a(
          class = "btn btn-primary",
          href = "articles/get_started.html",
          tags$i(class = "fa fa-rocket"),
          "Get Started",
                    style = "width:100%"
        )
      ),
      div(
        class = "col-md-3",
        a(
          class = "btn btn-primary",
          href = "articles/comentions.html",
          tags$i(class = "fa fa-object-group"),
          "Co-mentions",
                    style = "width:100%"
        )
      ),
      div(
        class = "col-md-3",
        a(
          class = "btn btn-primary",
          href = "articles/bind.html",
          tags$i(class = "fa fa-magnet"),
          "Bind",
                    style = "width:100%"
        )
      ),
      div(
        class = "col-md-3",
        a(
          class = "btn btn-primary",
          href = "articles/dynamic.html",
          tags$i(class = "fa fa-spinner fa-pulse fa-fw"),
          "Dynamic",
                    style = "width:100%"
        )
      )
    )
  )
)

br()

div(
  class = "panel panel-default",
  div(
    class = "panel-body",
    div(
      class = "row",
      div(
        class = "col-md-10",
        "graphTweets is part of the", a("twinetverse,", href = "http://twinetverse.john-coene.com/", target = "_blank"),
        "a set of packages for Twitter network analysis and visualisation, which comes with a book in which you will",
        "find even more use cases of sigmajs."
      ),
      div(
        class = "col-md-2",
        a(tags$i(class = "fa fa-book"), "Read", href = "http://twinetbook.john-coene.com/", target = "_blank", class = "btn btn-default", style="width:100%;")
      )
    ),
        br(),
    div(
      class = "row",
      div(
        class = "col-md-10",
        "graphTweets is being used to build all the networks of Chirp."
      ),
      div(
        class = "col-md-2",
        a(tags$i(class = "fa fa-twitter"), "Visit", href = "https://chirp.sh", target = "_blank", class = "btn btn-default", style="width:100%;")
      )
    )
  )
)

Install

install.packages("graphTweets") # CRAN release v0.4
devtools::install_github("JohnCoene/graphTweets") # dev version

Functions

Rationale

Functions are meant to be run in a specific order.

  1. Extract edges
  2. Extract the nodes

One can only know the nodes of a network based on the edges, so run them in that order. However, you can build a graph based on edges alone:

library(igraph) # for plot

tweets <- rtweet::search_tweets("rstats")

tweets %>% 
  gt_edges(text, screen_name, status_id) %>% 
  gt_graph() %>% 
  plot()

This is useful if you are building a large graph and don't need any meta data on the nodes (other than those you can compute from the graph, i.e.: degree like in the example above). If you need meta data on the nodes use gt_nodes.



JohnCoene/graphTweets documentation built on Jan. 8, 2020, 2:48 a.m.