<p><div><div><div><div data-show-faces="false" data-height="21" data-width="100" data-layout="button_count" data-send="true" data-href="https://www.r-bloggers.com/looking-back-in-2017-and-plans-for-2018/"></div></div><div></div></div><div></div></div>
<div>
(This article was first published on <strong><a href="http://msperlin.github.io/2017-12-30-Looking-Back-2017/"> Marcelo S. Perlin</a></strong>, and kindly contributed to <a rel="nofollow" href="https://www.r-bloggers.com/">R-bloggers)</a> </div>
<p> – </p>
<p>As we come close to the end of 2017, its time to look back. This has<br>
been a great year for me in many ways. This blog started as a way to<br>
write short pieces about using R for finance and promote my<br>
<a rel="nofollow" href="https://sites.google.com/view/pafdR/home" target="_blank">book</a> in an organic way.<br>
Today, I’m very happy with my decision. Discovering and trying new<br>
writing styles keeps my interest very alive. Academic research is very<br>
strict on what you can write and publish. It is satisfying to see that I<br>
can promote my work and have an impact in different ways, not only<br>
through the publication of academic papers.</p>
<p>My blog is build using a <a rel="nofollow" href="https://deanattali.com/beautiful-jekyll/" target="_blank">Jekyll<br>
template</a>, meaning the whole<br>
site, including individual posts, is built and controlled with editable<br>
text files and Github. All files related to posts follow the same<br>
structure, meaning I can easily gather the textual data and organize it<br>
in a nice <code>tibble</code>. Let’s first have a look in all post files:</p>
<div>
<div>
<pre><code>post.folder &lt;- '~/GitRepo/msperlin.github.io/_posts/'

my.f.posts &lt;- list.files(post.folder, full.names = TRUE)
my.f.posts

##  [1] &quot;/home/msperlin/GitRepo/msperlin.github.io/_posts//2017-01-15-First-post.md&quot;                  
##  [2] &quot;/home/msperlin/GitRepo/msperlin.github.io/_posts//2017-01-16-BatchGetSymbols.md&quot;             
##  [3] &quot;/home/msperlin/GitRepo/msperlin.github.io/_posts//2017-01-17-predatory.md&quot;                   
##  [4] &quot;/home/msperlin/GitRepo/msperlin.github.io/_posts//2017-01-18-GetHFData.md&quot;                   
##  [5] &quot;/home/msperlin/GitRepo/msperlin.github.io/_posts//2017-01-19-CalculatingBetas.md&quot;            
##  [6] &quot;/home/msperlin/GitRepo/msperlin.github.io/_posts//2017-01-30-Exams-with-dynamic-content.md&quot;  
##  [7] &quot;/home/msperlin/GitRepo/msperlin.github.io/_posts//2017-02-05-R-and-Tennis.md&quot;                
##  [8] &quot;/home/msperlin/GitRepo/msperlin.github.io/_posts//2017-02-06-My-Book-is-out.md&quot;              
##  [9] &quot;/home/msperlin/GitRepo/msperlin.github.io/_posts//2017-02-10-Shiny_Exams.md&quot;                 
## [10] &quot;/home/msperlin/GitRepo/msperlin.github.io/_posts//2017-02-13-R-and-Tennis-Players.md&quot;        
## [11] &quot;/home/msperlin/GitRepo/msperlin.github.io/_posts//2017-02-16-Writing-a-book.md&quot;              
## [12] &quot;/home/msperlin/GitRepo/msperlin.github.io/_posts//2017-03-05-Prophet-and_stock-market.md&quot;    
## [13] &quot;/home/msperlin/GitRepo/msperlin.github.io/_posts//2017-03-26-pmdR-exercises.md&quot;              
## [14] &quot;/home/msperlin/GitRepo/msperlin.github.io/_posts//2017-05-04-pafdR-is-out.md&quot;                
## [15] &quot;/home/msperlin/GitRepo/msperlin.github.io/_posts//2017-05-09-Studying-Pkg-Names.md&quot;          
## [16] &quot;/home/msperlin/GitRepo/msperlin.github.io/_posts//2017-05-15-R-Finance.md&quot;                   
## [17] &quot;/home/msperlin/GitRepo/msperlin.github.io/_posts//2017-05-29-Update-GetHFData-1-3.md&quot;        
## [18] &quot;/home/msperlin/GitRepo/msperlin.github.io/_posts//2017-06-01-Instaling-R-in-Linux.md&quot;        
## [19] &quot;/home/msperlin/GitRepo/msperlin.github.io/_posts//2017-08-24-Reinstalling_R_Packages.md&quot;     
## [20] &quot;/home/msperlin/GitRepo/msperlin.github.io/_posts//2017-08-24-Switching_to_Linux.md&quot;          
## [21] &quot;/home/msperlin/GitRepo/msperlin.github.io/_posts//2017-09-04-Package-GetLattesData.md&quot;       
## [22] &quot;/home/msperlin/GitRepo/msperlin.github.io/_posts//2017-09-10-Update-GetHFData-1-4.md&quot;        
## [23] &quot;/home/msperlin/GitRepo/msperlin.github.io/_posts//2017-09-14-Brazilian-Yield-Curve.md&quot;       
## [24] &quot;/home/msperlin/GitRepo/msperlin.github.io/_posts//2017-09-29-_Package-GetITRData.md&quot;         
## [25] &quot;/home/msperlin/GitRepo/msperlin.github.io/_posts//2017-12-06-_Package-GetDFPData.md&quot;         
## [26] &quot;/home/msperlin/GitRepo/msperlin.github.io/_posts//2017-12-13-_Serving-shiny-apps-internet.md&quot;
</code></pre>
</div>
</div>
<p>I posted 26 posts during 2017. Notice how all dates are in the beginning<br>
of the file name. I can easily convert that to a <code>Date</code> object using<br>
<code>as.Date</code>. Let’s organize it all in a nice <code>tibble</code>.</p>
<div>
<div>
<pre><code>library(tidyverse)

## ── Attaching packages ─────────────────────────────────────────────────────────────────────────── tidyverse 1.2.1 ──

## ✔ ggplot2 2.2.1     ✔ purrr   0.2.4
## ✔ tibble  1.4.1     ✔ dplyr   0.7.4
## ✔ tidyr   0.7.2     ✔ stringr 1.2.0
## ✔ readr   1.1.1     ✔ forcats 0.2.0

## ── Conflicts ────────────────────────────────────────────────────────────────────────────── tidyverse_conflicts() ──
## ✖ dplyr::filter() masks stats::filter()
## ✖ dplyr::lag()    masks stats::lag()

df.posts &lt;- tibble(ref.date = as.Date(basename(my.f.posts)),
                   ref.month = format(ref.date, '%m'), 
                   content = sapply(my.f.posts, function(x) paste0(readLines(x), collapse = '\n') ),
                   char.length = nchar(content)) %>%  # includes output code in length calculation..
  filter(ref.date > as.Date('2017-01-01') | ref.date &lt; as.Date('2018-01-01') ) # not really necessary but keep it for future

glimpse(df.posts)

## Observations: 26
## Variables: 4
## $ ref.date    </code></pre></div></div>