Permalink
Browse files

v5 CRAN prep

  • Loading branch information...
JohnCoene committed Aug 25, 2018
1 parent 87ee732 commit d9fe7c289f31ce9322c57d64bec05b9b4946595e
View
@@ -2,7 +2,7 @@ Package: graphTweets
Type: Package
Title: Visualise Twitter Interactions
Version: 0.5.0
Date: 2018-08-07
Date: 2018-08-25
Authors@R:
person("John", "Coene", email = "jcoenep@gmail.com",
role = c("aut", "cre"))
View
@@ -26,8 +26,9 @@ navbar:
- icon: fa-rocket
href: articles/get_started.html
- icon: fa-exchange
href: articles/hashtags.html
href: articles/comentions.html
- icon: fa-spinner fa-pulse fa-fw
href: articles/dynamic.html
- icon: fa-object-group
href: articles/bind.html
- icon: fa-wrench
View
@@ -11,9 +11,10 @@ Bug fixes and an additional function.
NEWS.md:
> # graphTweets 0.4.3
>
> * Added `gt_edges_hashes_` and `gt_edges_hashes` to build networks of #hashtags co-mentions.
> * Added `%<-%` from the zeallot package to unpack the nodes and edges.
> * Fixed `gt_dyn` bug where lifetime was not working properly.
> # graphTweets 0.5.0
>
> * `gt_co_edges` replaces `gt_edges_hashes`, it now works with other columns than just `hashtags`.
> * `gt_edges_hash` is _deprecated_ in favour of `gt_edges`.
> * `gt_edges_bind` and `gt_co_edges_bind` added to bind edges together and build more complex graphs.
> * Escape hatches, functions ending in `_` are no longer necessary and are thus deprecated.
View
@@ -96,13 +96,13 @@
</a>
</li>
<li>
<a href="articles/hashtags.html">
<a href="articles/comentions.html">
<span class="fa fa-exchange"></span>
</a>
</li>
<li>
<a>
<a href="articles/dynamic.html">
<span class="fa fa-spinner fa-pulse fa-fw"></span>
</a>
View

Large diffs are not rendered by default.

Oops, something went wrong.

Large diffs are not rendered by default.

Oops, something went wrong.
View

Large diffs are not rendered by default.

Oops, something went wrong.

Large diffs are not rendered by default.

Oops, something went wrong.
View
@@ -96,13 +96,13 @@
</a>
</li>
<li>
<a href="../articles/hashtags.html">
<a href="../articles/comentions.html">
<span class="fa fa-exchange"></span>
</a>
</li>
<li>
<a>
<a href="../articles/dynamic.html">
<span class="fa fa-spinner fa-pulse fa-fw"></span>
</a>
View
@@ -96,13 +96,13 @@
</a>
</li>
<li>
<a href="articles/hashtags.html">
<a href="articles/comentions.html">
<span class="fa fa-exchange"></span>
</a>
</li>
<li>
<a>
<a href="articles/dynamic.html">
<span class="fa fa-spinner fa-pulse fa-fw"></span>
</a>
View
Binary file not shown.
View
@@ -62,13 +62,13 @@
</a>
</li>
<li>
<a href="articles/hashtags.html">
<a href="articles/comentions.html">
<span class="fa fa-exchange"></span>
</a>
</li>
<li>
<a>
<a href="articles/dynamic.html">
<span class="fa fa-spinner fa-pulse fa-fw"></span>
</a>
@@ -175,8 +175,8 @@
<div id="install" class="section level2">
<h2 class="hasAnchor">
<a href="#install" class="anchor"></a>Install</h2>
<div class="sourceCode" id="cb1"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb1-1" data-line-number="1"><span class="kw">install.packages</span>(<span class="st">"graphTweets"</span>) <span class="co"># CRAN release v0.4</span></a>
<a class="sourceLine" id="cb1-2" data-line-number="2">devtools<span class="op">::</span><span class="kw"><a href="http://www.rdocumentation.org/packages/devtools/topics/install_github">install_github</a></span>(<span class="st">"JohnCoene/graphTweets"</span>) <span class="co"># dev version</span></a></code></pre></div>
<div class="sourceCode"><pre class="sourceCode r"><code class="sourceCode r"><span class="kw">install.packages</span>(<span class="st">"graphTweets"</span>) <span class="co"># CRAN release v0.4</span>
devtools<span class="op">::</span><span class="kw"><a href="http://www.rdocumentation.org/packages/devtools/topics/install_github">install_github</a></span>(<span class="st">"JohnCoene/graphTweets"</span>) <span class="co"># dev version</span></code></pre></div>
</div>
<div id="functions" class="section level2">
<h2 class="hasAnchor">
@@ -207,14 +207,14 @@ <h2 class="hasAnchor">
<li>Extract the nodes</li>
</ol>
<p>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:</p>
<div class="sourceCode" id="cb2"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb2-1" data-line-number="1"><span class="kw">library</span>(igraph) <span class="co"># for plot</span></a>
<a class="sourceLine" id="cb2-2" data-line-number="2"></a>
<a class="sourceLine" id="cb2-3" data-line-number="3">tweets &lt;-<span class="st"> </span>rtweet<span class="op">::</span><span class="kw"><a href="http://www.rdocumentation.org/packages/rtweet/topics/search_tweets">search_tweets</a></span>(<span class="st">"rstats"</span>)</a>
<a class="sourceLine" id="cb2-4" data-line-number="4"></a>
<a class="sourceLine" id="cb2-5" data-line-number="5">tweets <span class="op">%&gt;%</span><span class="st"> </span></a>
<a class="sourceLine" id="cb2-6" data-line-number="6"><span class="st"> </span><span class="kw"><a href="reference/edges.html">gt_edges</a></span>(text, screen_name, status_id) <span class="op">%&gt;%</span><span class="st"> </span></a>
<a class="sourceLine" id="cb2-7" data-line-number="7"><span class="st"> </span><span class="kw"><a href="reference/gt_graph.html">gt_graph</a></span>() <span class="op">%&gt;%</span><span class="st"> </span></a>
<a class="sourceLine" id="cb2-8" data-line-number="8"><span class="st"> </span><span class="kw">plot</span>()</a></code></pre></div>
<div class="sourceCode"><pre class="sourceCode r"><code class="sourceCode r"><span class="kw">library</span>(igraph) <span class="co"># for plot</span>
tweets &lt;-<span class="st"> </span>rtweet<span class="op">::</span><span class="kw"><a href="http://www.rdocumentation.org/packages/rtweet/topics/search_tweets">search_tweets</a></span>(<span class="st">"rstats"</span>)
tweets <span class="op">%&gt;%</span><span class="st"> </span>
<span class="st"> </span><span class="kw"><a href="reference/edges.html">gt_edges</a></span>(text, screen_name, status_id) <span class="op">%&gt;%</span><span class="st"> </span>
<span class="st"> </span><span class="kw"><a href="reference/gt_graph.html">gt_graph</a></span>() <span class="op">%&gt;%</span><span class="st"> </span>
<span class="st"> </span><span class="kw">plot</span>()</code></pre></div>
<p>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.: <code>degree</code> like in the example above). If you need meta data on the nodes use <code>gt_nodes</code>.</p>
</div>
</div>
View
@@ -96,13 +96,13 @@
</a>
</li>
<li>
<a href="../articles/hashtags.html">
<a href="../articles/comentions.html">
<span class="fa fa-exchange"></span>
</a>
</li>
<li>
<a>
<a href="../articles/dynamic.html">
<span class="fa fa-spinner fa-pulse fa-fw"></span>
</a>
@@ -215,27 +215,27 @@ <h1 class="page-header">
<code>gt_graph</code> added: use to convert to igraph object.</li>
</ul>
<p>Performance</p>
<div class="sourceCode" id="cb1"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb1-1" data-line-number="1"><span class="kw">library</span>(graphTweets)</a>
<a class="sourceLine" id="cb1-2" data-line-number="2"><span class="kw">library</span>(rtweet)</a>
<a class="sourceLine" id="cb1-3" data-line-number="3"></a>
<a class="sourceLine" id="cb1-4" data-line-number="4">token &lt;-<span class="st"> </span><span class="kw">create_token</span>(<span class="st">"APP"</span>, <span class="st">"xxxXXxxxx"</span>, <span class="st">"xXXXxxXX"</span>)</a>
<a class="sourceLine" id="cb1-5" data-line-number="5">tweets &lt;-<span class="st"> </span><span class="kw">search_tweets</span>(<span class="st">"#rstats"</span>, <span class="dt">token =</span> token)</a>
<a class="sourceLine" id="cb1-6" data-line-number="6"></a>
<a class="sourceLine" id="cb1-7" data-line-number="7">rbenchmark<span class="op">::</span><span class="kw"><a href="http://www.rdocumentation.org/packages/rbenchmark/topics/benchmark">benchmark</a></span>(</a>
<a class="sourceLine" id="cb1-8" data-line-number="8"> <span class="st">"v3.2"</span> =<span class="st"> </span>{</a>
<a class="sourceLine" id="cb1-9" data-line-number="9"> edges &lt;-<span class="st"> </span><span class="kw">getEdges</span>(<span class="kw">as.data.frame</span>(tweets), <span class="st">"screen_name"</span>, <span class="st">"text"</span>)</a>
<a class="sourceLine" id="cb1-10" data-line-number="10"> g &lt;-<span class="st"> </span>igraph<span class="op">::</span><span class="kw"><a href="http://www.rdocumentation.org/packages/igraph/topics/graph_from_data_frame">graph.data.frame</a></span>(edges, <span class="ot">TRUE</span>)</a>
<a class="sourceLine" id="cb1-11" data-line-number="11"> },</a>
<a class="sourceLine" id="cb1-12" data-line-number="12"> <span class="st">"v4"</span> =<span class="st"> </span>{</a>
<a class="sourceLine" id="cb1-13" data-line-number="13"> tweets <span class="op">%&gt;%</span><span class="st"> </span></a>
<a class="sourceLine" id="cb1-14" data-line-number="14"><span class="st"> </span><span class="kw"><a href="../reference/edges_deprecated.html">gt_edges_</a></span>() <span class="op">%&gt;%</span><span class="st"> </span></a>
<a class="sourceLine" id="cb1-15" data-line-number="15"><span class="st"> </span><span class="kw"><a href="../reference/gt_graph.html">gt_graph</a></span>() -&gt;<span class="st"> </span>g</a>
<a class="sourceLine" id="cb1-16" data-line-number="16"> }</a>
<a class="sourceLine" id="cb1-17" data-line-number="17">)</a>
<a class="sourceLine" id="cb1-18" data-line-number="18"></a>
<a class="sourceLine" id="cb1-19" data-line-number="19"> test replications elapsed relative user.self sys.self user.child sys.child</a>
<a class="sourceLine" id="cb1-20" data-line-number="20"><span class="dv">1</span> v3<span class="fl">.2</span> <span class="dv">100</span> <span class="fl">6.55</span> <span class="fl">1.492</span> <span class="fl">6.45</span> <span class="fl">0.06</span> <span class="ot">NA</span> <span class="ot">NA</span></a>
<a class="sourceLine" id="cb1-21" data-line-number="21"><span class="dv">2</span> v4 <span class="dv">100</span> <span class="fl">4.39</span> <span class="fl">1.000</span> <span class="fl">4.33</span> <span class="fl">0.05</span> <span class="ot">NA</span> <span class="ot">NA</span></a></code></pre></div>
<div class="sourceCode"><pre class="sourceCode r"><code class="sourceCode r"><span class="kw">library</span>(graphTweets)
<span class="kw">library</span>(rtweet)
token &lt;-<span class="st"> </span><span class="kw">create_token</span>(<span class="st">"APP"</span>, <span class="st">"xxxXXxxxx"</span>, <span class="st">"xXXXxxXX"</span>)
tweets &lt;-<span class="st"> </span><span class="kw">search_tweets</span>(<span class="st">"#rstats"</span>, <span class="dt">token =</span> token)
rbenchmark<span class="op">::</span><span class="kw">benchmark</span>(
<span class="st">"v3.2"</span> =<span class="st"> </span>{
edges &lt;-<span class="st"> </span><span class="kw">getEdges</span>(<span class="kw">as.data.frame</span>(tweets), <span class="st">"screen_name"</span>, <span class="st">"text"</span>)
g &lt;-<span class="st"> </span>igraph<span class="op">::</span><span class="kw"><a href="http://www.rdocumentation.org/packages/igraph/topics/graph_from_data_frame">graph.data.frame</a></span>(edges, <span class="ot">TRUE</span>)
},
<span class="st">"v4"</span> =<span class="st"> </span>{
tweets <span class="op">%&gt;%</span><span class="st"> </span>
<span class="st"> </span><span class="kw"><a href="../reference/edges_deprecated.html">gt_edges_</a></span>() <span class="op">%&gt;%</span><span class="st"> </span>
<span class="st"> </span><span class="kw"><a href="../reference/gt_graph.html">gt_graph</a></span>() -&gt;<span class="st"> </span>g
}
)
test replications elapsed relative user.self sys.self user.child sys.child
<span class="dv">1</span> v3<span class="fl">.2</span> <span class="dv">100</span> <span class="fl">6.55</span> <span class="fl">1.492</span> <span class="fl">6.45</span> <span class="fl">0.06</span> <span class="ot">NA</span> <span class="ot">NA</span>
<span class="dv">2</span> v4 <span class="dv">100</span> <span class="fl">4.39</span> <span class="fl">1.000</span> <span class="fl">4.33</span> <span class="fl">0.05</span> <span class="ot">NA</span> <span class="ot">NA</span></code></pre></div>
</div>
<div id="graphtweets-0-3-2" class="section level1">
<h1 class="page-header">
View
@@ -1,4 +1,4 @@
pandoc: 2.2.1
pandoc: 1.19.2.4
pkgdown: 1.1.0
pkgdown_sha: ~
articles:
View
@@ -98,13 +98,13 @@
</a>
</li>
<li>
<a href="../articles/hashtags.html">
<a href="../articles/comentions.html">
<span class="fa fa-exchange"></span>
</a>
</li>
<li>
<a>
<a href="../articles/dynamic.html">
<span class="fa fa-spinner fa-pulse fa-fw"></span>
</a>
@@ -98,13 +98,13 @@
</a>
</li>
<li>
<a href="../articles/hashtags.html">
<a href="../articles/comentions.html">
<span class="fa fa-exchange"></span>
</a>
</li>
<li>
<a>
<a href="../articles/dynamic.html">
<span class="fa fa-spinner fa-pulse fa-fw"></span>
</a>
@@ -98,13 +98,13 @@
</a>
</li>
<li>
<a href="../articles/hashtags.html">
<a href="../articles/comentions.html">
<span class="fa fa-exchange"></span>
</a>
</li>
<li>
<a>
<a href="../articles/dynamic.html">
<span class="fa fa-spinner fa-pulse fa-fw"></span>
</a>
@@ -98,13 +98,13 @@
</a>
</li>
<li>
<a href="../articles/hashtags.html">
<a href="../articles/comentions.html">
<span class="fa fa-exchange"></span>
</a>
</li>
<li>
<a>
<a href="../articles/dynamic.html">
<span class="fa fa-spinner fa-pulse fa-fw"></span>
</a>
@@ -221,7 +221,7 @@ <h2 class="hasAnchor" id="examples"><a class="anchor" href="#examples"></a>Examp
)
<span class='no'>tweets</span> <span class='kw'>%&gt;%</span>
<span class='fu'>gt_edges_from_text</span>(<span class='no'>status_id</span>, <span class='no'>screen_name</span>, <span class='no'>text</span>)</div><div class='output co'>#&gt; <span class='warning'>Warning: package 'bindrcpp' was built under R version 3.4.4</span></div><div class='output co'>#&gt; $edges
<span class='fu'>gt_edges_from_text</span>(<span class='no'>status_id</span>, <span class='no'>screen_name</span>, <span class='no'>text</span>)</div><div class='output co'>#&gt; $edges
#&gt; NULL
#&gt; </div><div class='input'>
</div></pre>
@@ -98,13 +98,13 @@
</a>
</li>
<li>
<a href="../articles/hashtags.html">
<a href="../articles/comentions.html">
<span class="fa fa-exchange"></span>
</a>
</li>
<li>
<a>
<a href="../articles/dynamic.html">
<span class="fa fa-spinner fa-pulse fa-fw"></span>
</a>
@@ -98,13 +98,13 @@
</a>
</li>
<li>
<a href="../articles/hashtags.html">
<a href="../articles/comentions.html">
<span class="fa fa-exchange"></span>
</a>
</li>
<li>
<a>
<a href="../articles/dynamic.html">
<span class="fa fa-spinner fa-pulse fa-fw"></span>
</a>
@@ -98,13 +98,13 @@
</a>
</li>
<li>
<a href="../articles/hashtags.html">
<a href="../articles/comentions.html">
<span class="fa fa-exchange"></span>
</a>
</li>
<li>
<a>
<a href="../articles/dynamic.html">
<span class="fa fa-spinner fa-pulse fa-fw"></span>
</a>
@@ -98,13 +98,13 @@
</a>
</li>
<li>
<a href="../articles/hashtags.html">
<a href="../articles/comentions.html">
<span class="fa fa-exchange"></span>
</a>
</li>
<li>
<a>
<a href="../articles/dynamic.html">
<span class="fa fa-spinner fa-pulse fa-fw"></span>
</a>
@@ -98,13 +98,13 @@
</a>
</li>
<li>
<a href="../articles/hashtags.html">
<a href="../articles/comentions.html">
<span class="fa fa-exchange"></span>
</a>
</li>
<li>
<a>
<a href="../articles/dynamic.html">
<span class="fa fa-spinner fa-pulse fa-fw"></span>
</a>
@@ -96,13 +96,13 @@
</a>
</li>
<li>
<a href="../articles/hashtags.html">
<a href="../articles/comentions.html">
<span class="fa fa-exchange"></span>
</a>
</li>
<li>
<a>
<a href="../articles/dynamic.html">
<span class="fa fa-spinner fa-pulse fa-fw"></span>
</a>
@@ -104,13 +104,13 @@
</a>
</li>
<li>
<a href="../articles/hashtags.html">
<a href="../articles/comentions.html">
<span class="fa fa-exchange"></span>
</a>
</li>
<li>
<a>
<a href="../articles/dynamic.html">
<span class="fa fa-spinner fa-pulse fa-fw"></span>
</a>
Oops, something went wrong.

0 comments on commit d9fe7c2

Please sign in to comment.