<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/package-getlattesdata/"></div></div><div></div></div><div></div></div>
<div>
(This article was first published on <strong><a href="http://msperlin.github.io/2017-09-04-Package-GetLattesData/"> R and Finance</a></strong>, and kindly contributed to <a rel="nofollow" href="https://www.r-bloggers.com/">R-bloggers)</a> </div>
<p> Downloading and reading bibliometric data from Lattes – </p>
<p><a rel="nofollow" href="http://lattes.cnpq.br/" target="_blank">Lattes</a> is the largest and unique platform for<br>
academic curriculumns. There you can find information about the academic<br>
work of <strong>ALL</strong> Brazilian scholars. It includes institution of PhD,<br>
current employer, field of work, all publications metadata and many<br>
more. It is an unique and reliable source of information for<br>
bibliometric studies.</p>
<p>I’ve been working with Lattes data for some time. Here I present a short<br>
list of papers that have used this data.</p>
<ul>
<li>
<p><a rel="nofollow" href="http://www.sciencedirect.com/science/article/pii/S1751157716301559" target="_blank">The Brazilian scientific output published in journals: A study<br>
based on a large CV<br>
database</a></p>
</li>
<li>
<p><a rel="nofollow" href="http://bibliotecadigital.fgv.br/ojs/index.php/rbfin/article/view/47157" target="_blank">The researchers, the publications and the journals of Finance in<br>
Brazil: An analysis based on resumes from the Lattes<br>
platform</a></p>
</li>
<li>
<p><a rel="nofollow" href="http://www.scielo.br/scielo.php?script=sci_arttext&pid=S1415-65552017000100062" target="_blank">Análise do Perfil dos Acadêmicos e de suas Publicações Científicas<br>
em Administração (in<br>
Portuguese)</a></p>
</li>
<li>
<p>Predatory publications in the Brazilian academic system: an<br>
empirical analysis (Working paper)</p>
</li>
</ul>
<p>Package <code>GetLattesData</code> is a wrap up of the functions that I’ve been<br>
using for acessing the dataset. It’s main innovation is the possibility<br>
of downloading data directly from Lattes, without any kind of manual<br>
work.</p>
<h1>Installation</h1>
<p>The package is not yet in CRAN. It should be there in a couple of days.<br>
In the meanwhile, you can install it using devtools.</p>
<div>
<pre><code>#install.packages('devtools')
devtools::install_github('msperlin/GetLattesData')
</code></pre>
</div>
<h1>Example of usage</h1>
<p>Let’s consider a simple example of downloading information for a group<br>
of scholars. I selected a couple of coleagues at my university. Their<br>
Lattes id can be easilly found in <a rel="nofollow" href="http://lattes.cnpq.br/" target="_blank">Lattes<br>
website</a>. After searching for a name, notice the<br>
internet address of the resulting CV, such as<br>
<a rel="nofollow" href="http://buscatextual.cnpq.br/buscatextual/visualizacv.do?id=K4713546D3" target="_blank">http://buscatextual.cnpq.br/buscatextual/visualizacv.do?id=K4713546D3</a>.<br>
Lattes ID is the final 10 digit code of this address. In our case, it is<br>
<code>'K4713546D3'</code>.</p>
<p>Since we all work in the business department of UFRGS, the quality of<br>
our publications is locally set by the Qualis ranking of field<br>
<code>'ADMINISTRAÇÃO PÚBLICA E DE EMPRESAS, CIÊNCIAS CONTÁBEIS E TURISMO'</code>.<br>
Qualis is the local journal ranking in Brazil. You can read more about<br>
Qualis in <a rel="nofollow" href="https://en.wikipedia.org/wiki/Qualis_(CAPES)" target="_blank">Wikipedia</a> and<br>
<a rel="nofollow" href="http://www.sciencedirect.com/science/article/pii/S1751157716301559" target="_blank">here</a></p>
<p>Now, based on the two sets of information, vector of ids and field of<br>
Qualis, we can use <code>GetLattesData</code> to download all up to date<br>
information about the researchers:</p>
<div>
<pre><code>library(GetLattesData)

# ids from EA-UFRGS
my.ids &lt;- c('K4713546D3', 'K4440252H7', 
            'K4783858A0', 'K4723925J2')

# qualis for the field of management
field.qualis = 'ADMINISTRAÇÃO PÚBLICA E DE EMPRESAS, CIÊNCIAS CONTÁBEIS E TURISMO'

l.out &lt;- gld_get_lattes_data(id.vec = my.ids, field.qualis = field.qualis)

## 
## Downloading file  /tmp/Rtmp9ODS2F/K4713546D3_2017-09-04.zip
## Downloading file  /tmp/Rtmp9ODS2F/K4440252H7_2017-09-04.zip
## Downloading file  /tmp/Rtmp9ODS2F/K4783858A0_2017-09-04.zip
## Downloading file  /tmp/Rtmp9ODS2F/K4723925J2_2017-09-04.zip
## Reading  K4713546D3_2017-09-04.zip -  Marcelo Scherer Perlin  found 18  papers
## Reading  K4440252H7_2017-09-04.zip -  Marcelo Brutti Righi    found 42  papers
## Reading  K4783858A0_2017-09-04.zip -  João Luiz Becker    found 58  papers
## Reading  K4723925J2_2017-09-04.zip -  Denis Borenstein    found 64  papers
</code></pre>
</div>
<p>The output <code>my.l</code> is a list with two items:</p>
<div>
<pre><code>names(l.out)

## [1] &quot;tpesq&quot;   &quot;tpublic&quot;
</code></pre>
</div>
<p>The first is a dataframe with information about researchers:</p>
<div>
<pre><code>tpesq &lt;- l.out$tpesq
str(tpesq)

## 'data.frame':    4 obs. of  9 variables:
##  $ name           : chr  &quot;Marcelo Scherer Perlin&quot; &quot;Marcelo Brutti Righi&quot; &quot;João Luiz Becker&quot; &quot;Denis Borenstein&quot;
##  $ last.update    : Date, format: &quot;2017-08-29&quot; &quot;2017-08-02&quot; ...
##  $ phd.institution: chr  &quot;University of Reading&quot; &quot;Universidade Federal de Santa Maria&quot; &quot;University Of California At Los Angeles&quot; &quot;University of Strathclyde&quot;
##  $ phd.start.year : chr  &quot;2007&quot; &quot;2013&quot; &quot;1982&quot; &quot;1991&quot;
##  $ phd.end.year   : chr  &quot;2010&quot; &quot;2015&quot; &quot;1986&quot; &quot;1995&quot;
##  $ country.origin : Factor w/ 1 level &quot;Brasil&quot;: 1 1 1 1
##  $ Major Field    : chr  &quot;CIENCIAS_SOCIAIS_APLICADAS&quot; &quot;CIENCIAS_SOCIAIS_APLICADAS&quot; &quot;CIENCIAS_SOCIAIS_APLICADAS&quot; &quot;ENGENHARIAS&quot;
##  $ Minor Field    : chr  &quot;Administração&quot; &quot;Administração&quot; &quot;Administração&quot; &quot;Engenharia de Produção&quot;
##  $ id.file        : chr  &quot;K4713546D3_2017-09-04.zip&quot; &quot;K4440252H7_2017-09-04.zip&quot; &quot;K4783858A0_2017-09-04.zip&quot; &quot;K4723925J2_2017-09-04.zip&quot;
</code></pre>
</div>
<p>and the second dataframe containing information about all publications,<br>
including Qualis and SJR:</p>
<div>
<pre><code>tpublic &lt;- l.out$tpublic
str(tpublic)

## 'data.frame':    182 obs. of  13 variables:
##  $ name         : chr  &quot;Marcelo Scherer Perlin&quot; &quot;Marcelo Scherer Perlin&quot; &quot;Marcelo Scherer Perlin&quot; &quot;Marcelo Scherer Perlin&quot; ...
##  $ article.title: chr  &quot;Análise do Perfil dos Acadêmicos e de suas Publicações Científicas em Administração&quot; &quot;The Brazilian scientific output published in journals: A study based on a large CV database&quot; &quot;THE FORECASTING POWER OF INTERNET SEARCH QUERIES IN THE BRAZILIAN FINANCIAL MARKET&quot; &quot;A multistage stochastic programming asset-liability management model: an application to the Brazilian pension fund industry&quot; ...
##  $ year         : chr  &quot;2017&quot; &quot;2017&quot; &quot;2017&quot; &quot;2017&quot; ...
##  $ language     : chr  &quot;Português&quot; &quot;Inglês&quot; &quot;Inglês&quot; &quot;Inglês&quot; ...
##  $ journal.title: chr  &quot;RAC. Revista de Administração Contemporânea (Impresso)&quot; &quot;Journal of Informetrics&quot; &quot;RAM. REVISTA DE ADMINISTRAÇÃO MACKENZIE (ONLINE)&quot; &quot;OPTIMIZATION AND ENGINEERING&quot; ...
##  $ ISSN         : chr  &quot;1415-6555&quot; &quot;1751-1577&quot; &quot;1678-6971&quot; &quot;1389-4420&quot; ...
##  $ start.page   : chr  &quot;62&quot; &quot;18&quot; &quot;184&quot; &quot;349&quot; ...
##  $ end.page     : chr  &quot;83&quot; &quot;31&quot; &quot;210&quot; &quot;368&quot; ...
##  $ order.aut    : chr  &quot;2&quot; &quot;1&quot; &quot;3&quot; &quot;3&quot; ...
##  $ n.authors    : chr  &quot;3&quot; &quot;5&quot; &quot;3&quot; &quot;5&quot; ...
##  $ qualis       : chr  &quot;A2&quot; NA &quot;B1&quot; &quot;A2&quot; ...
##  $ SJR          : num  NA 2.029 NA 0.481 NA ...
##  $ H.SJR        : int  NA 50 NA 29 NA NA 45 NA NA NA ...
</code></pre>
</div>
<h2>An application of <code>GetLattesData</code></h2>
<p>Based on <code>GetLattesData</code> and other packages, it is easy to create<br>
academic reports for a large number of researchers. See next, where we<br>
plot the number of publications for each researcher, conditioning on<br>
Qualis ranking.</p>
<div>
<pre><code>library(ggplot2)

p &lt;- ggplot(tpublic, aes(x = qualis)) +
  geom_bar(position = 'identity') + facet_wrap(~name) +
  labs(x = paste0('Qualis: ', field.qualis))
print(p)
</code></pre>
</div>
<p><img alt="" src="https://i0.wp.com/msperlin.github.io/img/2017-09-04-Package-GetLattesData_files/figure-markdown_strict/unnamed-chunk-5-1.png?w=456" data-recalc-dims="1"></p>
<p>We can also use <code>dplyr</code> to do some simple assessment of academic<br>
productivity:</p>
<div>
<pre><code>library(dplyr)

## 
## Attaching package: 'dplyr'

## The following objects are masked from 'package:stats':
## 
##     filter, lag

## The following objects are masked from 'package:base':
## 
##     intersect, setdiff, setequal, union

my.tab &lt;- tpublic %>%
  group_by(name) %>%
  summarise(n.papers = n(),
            max.SJR = max(SJR, na.rm = T),
            mean.SJR = mean(SJR, na.rm = T),
            n.A1.qualis = sum(qualis == 'A1', na.rm = T),
            n.A2.qualis = sum(qualis == 'A2', na.rm = T),
            median.authorship = median(as.numeric(order.aut), na.rm = T ))

knitr::kable(my.tab)
</code></pre>
</div>
<table>
<thead>
<tr>
<th align="left">name</th>
<th align="right">n.papers</th>
<th align="right">max.SJR</th>
<th align="right">mean.SJR</th>
<th align="right">n.A1.qualis</th>
<th align="right">n.A2.qualis</th>
<th align="right">median.authorship</th>
</tr>
</thead>
<tbody>
<tr>
<td align="left">Denis Borenstein</td>
<td align="right">64</td>
<td align="right">3.674</td>
<td align="right">1.3165610</td>
<td align="right">22</td>
<td align="right">15</td>
<td align="right">2</td>
</tr>
<tr>
<td align="left">João Luiz Becker</td>
<td align="right">58</td>
<td align="right">3.885</td>
<td align="right">0.8090000</td>
<td align="right">5</td>
<td align="right">13</td>
<td align="right">2</td>
</tr>
<tr>
<td align="left">Marcelo Brutti Righi</td>
<td align="right">42</td>
<td align="right">1.767</td>
<td align="right">0.3961111</td>
<td align="right">6</td>
<td align="right">14</td>
<td align="right">1</td>
</tr>
<tr>
<td align="left">Marcelo Scherer Perlin</td>
<td align="right">18</td>
<td align="right">2.029</td>
<td align="right">0.7755000</td>
<td align="right">2</td>
<td align="right">3</td>
<td align="right">1</td>
</tr>
</tbody>
</table>
	<p>
<div>
<div>To <strong>leave a comment</strong> for the author, please follow the link and comment on their blog: <strong><a href="http://msperlin.github.io/2017-09-04-Package-GetLattesData/"> R and Finance</a></strong>.</div>
<hr>
<a rel="nofollow" href="https://www.r-bloggers.com/">R-bloggers.com</a> offers <strong><a rel="nofollow" href="https://feedburner.google.com/fb/a/mailverify?uri=RBloggers">daily e-mail updates</a></strong> about <a rel="nofollow" href="https://www.r-project.org/" title="The R Project for Statistical Computing">R</a> news and <a rel="nofollow" href="https://www.r-bloggers.com/search/tutorial" title="R tutorials">tutorials</a> on topics such as: <a rel="nofollow" href="https://www.r-bloggers.com/search/data%20science" title="Data science">Data science</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/Big%20Data" title="Big Data">Big Data, <a rel="nofollow" href="https://www.r-users.com/" title="R jobs">R jobs</a>, visualization (<a rel="nofollow" href="https://www.r-bloggers.com/search/ggplot2" title="ggplot and ggplot2 tutorials">ggplot2</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/boxplot" title="Boxplots using lattice and ggplot2 tutorials">Boxplots</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/map" title="Maps and gis">maps</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/animation" title="Animation in R">animation</a>), programming (<a rel="nofollow" href="https://www.r-bloggers.com/search/RStudio" title="RStudio IDE for R">RStudio</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/sweave" title="Sweave and literate programming">Sweave</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/LaTeX" title="LaTeX in R">LaTeX</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/SQL" title="SQL and databases">SQL</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/eclipse" title="Eclipse IDE for R">Eclipse</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/git" title="git and github, Version Control System">git</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/hadoop" title="Large data in R using Hadoop">hadoop</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/Web+Scraping" title="Web Scraping of google, facebook, yahoo, twitter and more using R">Web Scraping</a>) statistics (<a rel="nofollow" href="https://www.r-bloggers.com/search/regression" title="Regressions and ANOVA analysis tutorials">regression</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/PCA" title="principal component analysis tutorial">PCA</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/time+series" title="Time series">time series</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/trading" title="finance trading">trading</a>) and more...
<img width="1" alt="" src="http://feeds.feedburner.com/~r/RBloggers/~4/ctu8Hpe-_Qw" height="1"></a></div>