Introduction to getLattes

Roney Fraga Souza

2020-06-12

The Lattes platform has been hosting curricula of Brazilian researchers since the late 1990s, containing more than 5 million curricula. The data from the Lattes curricula can be downloaded to XML format, the complexity of this reading process motivated the development of the getLattes package, which imports the information from the XML files to a list in the R software and then tabulates the Lattes data to a data.frame.

The main information contained in XML files, and imported via getLattes, are:

From the functionalities presented in this package, the main challenge to work with the Lattes curriculum data is now to download the data, as there are Captchas. To download a lot of curricula I suggest the use of Captchas Negated by Python reQuests - CNPQ. The second barrier to be overcome is the management and processing of a large volume of data, the whole Lattes platform in XML files totals over 200 GB. In this tutorial we will focus on the getLattes package features, being the reader responsible for download and manage the files.

Follow an example of how to search and download data from the Lattes website.

Installation

To install the released version of getLattes from github.

# install and load devtools from CRAN
install.packages("devtools")
library(devtools)

# install and load getLattes
devtools::install_github("roneyfraga/getLattes")

Load getLattes.

library(getLattes)

# support packages
library(dplyr)
library(tibble)
library(pipeR)

Extract XML from zip

The variable to merge the table extract from any get function is the id variable. The id is 16 digits, unique to each curriculum. However, it is important to rename the .xml file from curriculo.xml to [16 digits id].xml. As Lattes has many versions of XML structure, the more consistent way to extract id is from the file name.


# the zip file(s) (is)are stored in datatest/
# unzipLattes(filezip='2854855744345507.zip', path='datatest/')
# unzipLattes(filezip='*.zip', path='datatest/')

# the zip files are stored in the working directory
unzipLattes(filezip='*.zip')

Import XML curriculum data


# the file 4984859173592703.xml 
# cl <- readLattes(filexml='4984859173592703.xml', path='datatest/')

# import several files
# cls <- readLattes(filexml='*.xml$', path='datatest/')

# import xml files from working directory
cls <- readLattes(filexml='*.xml$')

As example, 2 curricula data xmlsLattes imported as an R list.

data(xmlsLattes)
length(xmlsLattes)
#> [1] 2
names(xmlsLattes[[1]])
#> [1] "DADOS-GERAIS"           "PRODUCAO-BIBLIOGRAFICA" "PRODUCAO-TECNICA"      
#> [4] "OUTRA-PRODUCAO"         "DADOS-COMPLEMENTARES"   ".attrs"                
#> [7] "id"

get functions

To read data from only one curriculum any function get can be executed singly, to import data from two or more curricula is easier to use get functions with lapply.

# to import from one curriculum 
getDadosGerais(xmlsLattes[[1]])
#>             nome.completo
#> 1 Antonio Marcio Buainain
#>                                                                                         nome.em.citacoes.bibliograficas
#> 1 BUAINAIN, Antonio Marcio;Buainain, Antonio Márcio;Buainain, Antônio Márcio;BUAINAIN, ANTONIO;ANTONIO, MARCIO BUAINAIN
#>   nacionalidade pais.de.nascimento uf.nascimento cidade.nascimento
#> 1             B             Brasil            MS      Campo Grande
#>   permissao.de.divulgacao data.falecimento sigla.pais.nacionalidade
#> 1                     NAO                                       BRA
#>   pais.de.nacionalidade                              orcid.id               id
#> 1                Brasil https://orcid.org/0000-0002-1779-5589 3051627641386529
#>   data.atualizacao
#> 1         16042020

Import general data from 2 curricula. The output is a list of data frames, converted by a unique data frame with bind_rows.

lt <- lapply(xmlsLattes, getDadosGerais) 
lt <- bind_rows(lt)
glimpse(lt)
#> Rows: 2
#> Columns: 13
#> $ nome.completo                   <chr> "Antonio Marcio Buainain", "Jose Mari…
#> $ nome.em.citacoes.bibliograficas <chr> "BUAINAIN, Antonio Marcio;Buainain, A…
#> $ nacionalidade                   <chr> "B", "B"
#> $ pais.de.nascimento              <chr> "Brasil", "Brasil"
#> $ uf.nascimento                   <chr> "MS", "SP"
#> $ cidade.nascimento               <chr> "Campo Grande", "São Paulo"
#> $ permissao.de.divulgacao         <chr> "NAO", "NAO"
#> $ data.falecimento                <chr> "", ""
#> $ sigla.pais.nacionalidade        <chr> "BRA", "BRA"
#> $ pais.de.nacionalidade           <chr> "Brasil", "Brasil"
#> $ orcid.id                        <chr> "https://orcid.org/0000-0002-1779-558…
#> $ id                              <chr> "3051627641386529", "4984859173592703"
#> $ data.atualizacao                <chr> "16042020", "20032020"

To write quickly, I will use pipe %>>% from pipeR package.

lapply(xmlsLattes, getDadosGerais) %>>% 
    bind_rows %>>% 
    glimpse
#> Rows: 2
#> Columns: 13
#> $ nome.completo                   <chr> "Antonio Marcio Buainain", "Jose Mari…
#> $ nome.em.citacoes.bibliograficas <chr> "BUAINAIN, Antonio Marcio;Buainain, A…
#> $ nacionalidade                   <chr> "B", "B"
#> $ pais.de.nascimento              <chr> "Brasil", "Brasil"
#> $ uf.nascimento                   <chr> "MS", "SP"
#> $ cidade.nascimento               <chr> "Campo Grande", "São Paulo"
#> $ permissao.de.divulgacao         <chr> "NAO", "NAO"
#> $ data.falecimento                <chr> "", ""
#> $ sigla.pais.nacionalidade        <chr> "BRA", "BRA"
#> $ pais.de.nacionalidade           <chr> "Brasil", "Brasil"
#> $ orcid.id                        <chr> "https://orcid.org/0000-0002-1779-558…
#> $ id                              <chr> "3051627641386529", "4984859173592703"
#> $ data.atualizacao                <chr> "16042020", "20032020"

Where . -> res means the result was saved to res object.

lapply(xmlsLattes, getDadosGerais) %>>% 
    bind_rows %>>% 
    (. -> res)

glimpse(res)
#> Rows: 2
#> Columns: 13
#> $ nome.completo                   <chr> "Antonio Marcio Buainain", "Jose Mari…
#> $ nome.em.citacoes.bibliograficas <chr> "BUAINAIN, Antonio Marcio;Buainain, A…
#> $ nacionalidade                   <chr> "B", "B"
#> $ pais.de.nascimento              <chr> "Brasil", "Brasil"
#> $ uf.nascimento                   <chr> "MS", "SP"
#> $ cidade.nascimento               <chr> "Campo Grande", "São Paulo"
#> $ permissao.de.divulgacao         <chr> "NAO", "NAO"
#> $ data.falecimento                <chr> "", ""
#> $ sigla.pais.nacionalidade        <chr> "BRA", "BRA"
#> $ pais.de.nacionalidade           <chr> "Brasil", "Brasil"
#> $ orcid.id                        <chr> "https://orcid.org/0000-0002-1779-558…
#> $ id                              <chr> "3051627641386529", "4984859173592703"
#> $ data.atualizacao                <chr> "16042020", "20032020"

It is worth remembering that all variable names obtained by get functions are the transcription of the field names in the XML file, the - being replaced with . and the capital letters replaced with lower case letters.

Advisory

Ph.D. Advisory

lapply(xmlsLattes, getOrientacoesDoutorado) %>>% 
    bind_rows %>>% 
    glimpse()
#> Rows: 20
#> Columns: 24
#> $ natureza                    <chr> "Tese de doutorado", "Tese de doutorado",…
#> $ titulo                      <chr> "Redes de Comércio Justo e Solidário: Org…
#> $ ano                         <chr> "2012", "2009", "2009", "2011", "2015", "…
#> $ pais                        <chr> "Brasil", "Brasil", "Brasil", "Brasil", "…
#> $ idioma                      <chr> "Português", "Português", "Português", "P…
#> $ home.page                   <chr> "", "", "", "", "", "", "", "", "", "", "…
#> $ flag.relevancia             <chr> "NAO", "NAO", "NAO", "NAO", "NAO", "NAO",…
#> $ doi                         <chr> "", "", "", "", "", "", "", "", "", "", "…
#> $ titulo.ingles               <chr> "", "", "", "", "", "", "", "", "", "", "…
#> $ tipo.de.orientacao          <chr> "ORIENTADOR_PRINCIPAL", "ORIENTADOR_PRINC…
#> $ nome.do.orientado           <chr> "Isabel Fernandes Pinto Viegas", "Patríci…
#> $ codigo.instituicao          <chr> "001400000995", "007900000004", "00140000…
#> $ nome.da.instituicao         <chr> "Instituto de Economia - Unicamp", "Unive…
#> $ codigo.orgao                <chr> "", "", "", "", "", "", "", "", "", "", "…
#> $ nome.orgao                  <chr> "", "", "", "", "", "", "", "", "", "", "…
#> $ codigo.curso                <chr> "90000012", "33070202", "90000017", "9000…
#> $ nome.do.curso               <chr> "Economia", "Ciência Econômica", "Desenvo…
#> $ flag.bolsa                  <chr> "NAO", "NAO", "NAO", "NAO", "NAO", "NAO",…
#> $ codigo.agencia.financiadora <chr> "", "", "", "", "", "", "", "", "", "0022…
#> $ nome.da.agencia             <chr> "", "", "", "", "", "", "", "", "", "Cons…
#> $ numero.de.paginas           <chr> "", "", "", "", "", "", "229", "", "", ""…
#> $ numero.id.orientado         <chr> "8711022590286430", "7566270566853161", "…
#> $ nome.do.curso.ingles        <chr> "", "Economy", "", "", "", "", "Economy",…
#> $ id                          <chr> "3051627641386529", "3051627641386529", "…

Master Advisory

lapply(xmlsLattes, getOrientacoesMestrado) %>>% 
    bind_rows %>>% 
    glimpse()
#> Rows: 27
#> Columns: 25
#> $ natureza                    <chr> "Dissertação de mestrado", "Dissertação d…
#> $ tipo                        <chr> "ACADEMICO", "ACADEMICO", "ACADEMICO", "A…
#> $ titulo                      <chr> "Focalização de políticas públicas: Teori…
#> $ ano                         <chr> "2004", "2003", "2006", "2005", "2008", "…
#> $ pais                        <chr> "Brasil", "Brasil", "Brasil", "Brasil", "…
#> $ idioma                      <chr> "Português", "Português", "Português", "P…
#> $ home.page                   <chr> "", "", "", "", "", "", "", "", "", "", "…
#> $ flag.relevancia             <chr> "NAO", "NAO", "NAO", "NAO", "NAO", "NAO",…
#> $ doi                         <chr> "", "", "", "", "", "", "", "", "", "", "…
#> $ titulo.ingles               <chr> "", "", "", "", "", "", "", "", "", "", "…
#> $ tipo.de.orientacao          <chr> "ORIENTADOR_PRINCIPAL", "ORIENTADOR_PRINC…
#> $ nome.do.orientado           <chr> "Carolina Junqueira Homem de Mello", "Gil…
#> $ codigo.instituicao          <chr> "007900000004", "007900000004", "00790000…
#> $ nome.da.instituicao         <chr> "Universidade Estadual de Campinas", "Uni…
#> $ codigo.orgao                <chr> "", "", "", "", "", "", "", "", "", "", "…
#> $ nome.orgao                  <chr> "", "", "", "", "", "", "", "", "", "", "…
#> $ codigo.curso                <chr> "33070202", "60008342", "60008342", "9000…
#> $ nome.do.curso               <chr> "Ciência Econômica", "Desenvolvimento Eco…
#> $ flag.bolsa                  <chr> "NAO", "NAO", "NAO", "NAO", "NAO", "NAO",…
#> $ codigo.agencia.financiadora <chr> "", "", "", "", "", "", "", "", "", "", "…
#> $ nome.da.agencia             <chr> "", "", "", "", "", "", "", "", "", "", "…
#> $ numero.de.paginas           <chr> "150", "237", "", "", "", "", "", "", "",…
#> $ numero.id.orientado         <chr> "", "", "8747418319288543", "", "50941418…
#> $ nome.do.curso.ingles        <chr> "Economy", "Economy", "Economy", "", "Eco…
#> $ id                          <chr> "3051627641386529", "3051627641386529", "…

Post Doctorate

lapply(xmlsLattes, getOrientacoesPosDoutorado) %>>% 
    bind_rows %>>% 
    glimpse()
#> Rows: 3
#> Columns: 24
#> $ natureza                    <chr> "Supervisão de pós-doutorado", "Supervisã…
#> $ titulo                      <chr> "", "Avaliação de Impactos Socioeconômico…
#> $ ano                         <chr> "2010", "2011", "2013"
#> $ pais                        <chr> "Brasil", "Brasil", "Brasil"
#> $ idioma                      <chr> "Português", "Português", "Português"
#> $ home.page                   <chr> "", "", ""
#> $ flag.relevancia             <chr> "NAO", "NAO", "NAO"
#> $ doi                         <chr> "", "", ""
#> $ titulo.ingles               <chr> "", "", ""
#> $ tipo.de.orientacao          <chr> "", "", ""
#> $ nome.do.orientado           <chr> "Maria Ester Soares Dal Poz", "Divina Apa…
#> $ codigo.instituicao          <chr> "003100000996", "007900000004", "00790000…
#> $ nome.da.instituicao         <chr> "Instituto de Economia - Unicamp", "Unive…
#> $ codigo.orgao                <chr> "", "", ""
#> $ nome.orgao                  <chr> "", "", ""
#> $ codigo.curso                <chr> "", "", ""
#> $ nome.do.curso               <chr> "", "", ""
#> $ flag.bolsa                  <chr> "NAO", "NAO", "NAO"
#> $ codigo.agencia.financiadora <chr> "", "", ""
#> $ nome.da.agencia             <chr> "", "", ""
#> $ numero.de.paginas           <chr> "", "", ""
#> $ numero.id.orientado         <chr> "", "", ""
#> $ nome.do.curso.ingles        <chr> "", "", ""
#> $ id                          <chr> "4984859173592703", "4984859173592703", "…

Other

lapply(xmlsLattes, getOrientacoesOutras) %>>% 
    bind_rows %>>% 
    glimpse()
#> Rows: 74
#> Columns: 24
#> $ natureza                     <chr> "INICIACAO_CIENTIFICA", "INICIACAO_CIENT…
#> $ tipo                         <chr> "", "", "", "", "", "", "", "", "", "", …
#> $ titulo                       <chr> "Fatores condicionantes aos investimento…
#> $ ano                          <chr> "2000", "1988", "2000", "2003", "2003", …
#> $ pais                         <chr> "Brasil", "Brasil", "Brasil", "Brasil", …
#> $ idioma                       <chr> "Português", "Português", "Português", "…
#> $ home.page                    <chr> "", "", "", "", "", "", "", "", "", "", …
#> $ flag.relevancia              <chr> "NAO", "NAO", "NAO", "NAO", "NAO", "NAO"…
#> $ doi                          <chr> "", "", "", "", "", "", "", "", "", "", …
#> $ titulo.ingles                <chr> "", "", "", "", "", "", "", "", "", "", …
#> $ tipo.ingles                  <chr> "", "", "", "", "", "", "", "", "", "", …
#> $ nome.do.orientado            <chr> "Daniela Silva Pires", "Jeane Shigueko U…
#> $ codigo.instituicao           <chr> "001400000995", "001400000995", "0014000…
#> $ nome.da.instituicao          <chr> "Instituto de Economia - Unicamp", "Inst…
#> $ codigo.curso                 <chr> "90000014", "90000014", "90000014", "900…
#> $ nome.do.curso                <chr> "Economia", "Economia", "Economia", "Eco…
#> $ flag.bolsa                   <chr> "NAO", "NAO", "NAO", "NAO", "NAO", "SIM"…
#> $ codigo.agencia.financiadora  <chr> "", "", "", "", "", "037700000002", "", …
#> $ nome.da.agencia              <chr> "", "", "", "", "", "Fundação de Amparo …
#> $ tipo.de.orientacao.concluida <chr> "CO_ORIENTADOR", "CO_ORIENTADOR", "CO_OR…
#> $ numero.de.paginas            <chr> "0", "0", "0", "0", "0", "", "", "", "",…
#> $ numero.id.orientado          <chr> "", "", "", "", "", "", "", "", "", "", …
#> $ nome.do.curso.ingles         <chr> "", "", "", "", "", "", "", "", "", "", …
#> $ id                           <chr> "3051627641386529", "3051627641386529", …

Published Academic Papers

lapply(xmlsLattes, getArtigosPublicados) %>>% 
    bind_rows %>>% 
    as_tibble %>>% 
    (. -> pub)

glimpse(pub)
#> Rows: 183
#> Columns: 23
#> $ natureza                       <chr> "COMPLETO", "COMPLETO", "COMPLETO", "C…
#> $ titulo.do.artigo               <chr> "Notas sobre a produção de alimentos e…
#> $ ano.do.artigo                  <chr> "1988", "1994", "1996", "2000", "2002"…
#> $ pais.de.publicacao             <chr> "", "", "", "", "", "", "", "", "", ""…
#> $ idioma                         <chr> "Português", "Inglês", "Português", "P…
#> $ meio.de.divulgacao             <chr> "IMPRESSO", "IMPRESSO", "IMPRESSO", "I…
#> $ home.page.do.trabalho          <chr> "", "", "", "", "[http://www.economia.…
#> $ flag.relevancia                <chr> "NAO", "NAO", "NAO", "NAO", "NAO", "NA…
#> $ doi                            <chr> "", "", "", "", "", "", "", "", "", ""…
#> $ titulo.do.artigo.ingles        <chr> "", "", "", "", "", "", "", "", "", ""…
#> $ flag.divulgacao.cientifica     <chr> "NAO", "NAO", "NAO", "NAO", "NAO", "NA…
#> $ titulo.do.periodico.ou.revista <chr> "Revista Ensaios Economia", "Revista B…
#> $ issn                           <chr> "", "00347140", "", "14139375", "15171…
#> $ volume                         <chr> "4-5", "48", "1", "9", "4", "2", "1", …
#> $ fasciculo                      <chr> "2-1", "4", "2", "", "2", "1", "1", ""…
#> $ serie                          <chr> "", "", "", "", "2", "1", "1", "", "6"…
#> $ pagina.inicial                 <chr> "111", "1", "14", "145", "305", "3", "…
#> $ pagina.final                   <chr> "133", "20", "22", "153", "313", "47",…
#> $ local.de.publicacao            <chr> "Belo Horizonte/Minas Gerais", "Rio de…
#> $ autores                        <chr> "Antonio Marcio Buainain", "Antonio Ma…
#> $ autores.citacoes               <chr> "BUAINAIN, Antonio Marcio;Buainain, An…
#> $ autores.id                     <chr> "3051627641386529", "3051627641386529;…
#> $ id                             <chr> "3051627641386529", "3051627641386529"…

Normalize functions

The information obtained from the Lattes curriculum is not standardized, so each user inserts the information in certain predefined fields. The problem with such an approach is the errors when inserting the data, here are some examples: - two co-authors of an article, each one feeds his or her Lattes curriculum. However, each one can insert different ISSN codes for the same scientific journal, which can change the journal-title, one title as (Print) and the other as (Online). - the two authors may insert different years for the same article. - the same two authors may mistype the journal-title.

The functions normalizeByDoi, normalizeByJournal, and normalizeByYear correct most problems related to data entry errors.

normalizeByDoi groups all articles together as the same DOI code and uses the most frequent information in the title, year, and journal’s name.

# use explict arguments
normalizeByDoi( pub, doi='doi', year='ano.do.artigo', issn='issn', paperTitle='titulo.do.artigo', journalName='titulo.do.periodico.ou.revista')
#> # A tibble: 183 x 28
#>    natureza titulo.do.artig… ano.do.artigo_o… pais.de.publica… idioma
#>    <chr>    <chr>            <chr>            <chr>            <chr> 
#>  1 COMPLETO Notas sobre a p… 1988             ""               Portu…
#>  2 COMPLETO Structural adju… 1994             ""               Inglês
#>  3 COMPLETO Agribusiness e … 1996             ""               Portu…
#>  4 COMPLETO Propriedade int… 2000             ""               Portu…
#>  5 COMPLETO Comentários sob… 2002             ""               Portu…
#>  6 COMPLETO Does community-… 2001             ""               Inglês
#>  7 COMPLETO In search of me… 2004             ""               Portu…
#>  8 COMPLETO Desafios dos pr… 2003             ""               Portu…
#>  9 COMPLETO Por que reforma… 2003             ""               Portu…
#> 10 COMPLETO Software livre … 2004             ""               Portu…
#> # … with 173 more rows, and 23 more variables: meio.de.divulgacao <chr>,
#> #   home.page.do.trabalho <chr>, flag.relevancia <chr>, doi.x <chr>,
#> #   titulo.do.artigo.ingles <chr>, flag.divulgacao.cientifica <chr>,
#> #   titulo.do.periodico.ou.revista_old <chr>, issn_old <chr>, volume <chr>,
#> #   fasciculo <chr>, serie <chr>, pagina.inicial <chr>, pagina.final <chr>,
#> #   local.de.publicacao <chr>, autores <chr>, autores.citacoes <chr>,
#> #   autores.id <chr>, id <chr>, doi.y <chr>,
#> #   titulo.do.periodico.ou.revista <chr>, issn <chr>, ano.do.artigo <chr>,
#> #   titulo.do.artigo <chr>

# use de defult data frame from getArtigosPublicados
normalizeByDoi(pub)
#> # A tibble: 183 x 28
#>    natureza titulo.do.artig… ano.do.artigo_o… pais.de.publica… idioma
#>    <chr>    <chr>            <chr>            <chr>            <chr> 
#>  1 COMPLETO Notas sobre a p… 1988             ""               Portu…
#>  2 COMPLETO Structural adju… 1994             ""               Inglês
#>  3 COMPLETO Agribusiness e … 1996             ""               Portu…
#>  4 COMPLETO Propriedade int… 2000             ""               Portu…
#>  5 COMPLETO Comentários sob… 2002             ""               Portu…
#>  6 COMPLETO Does community-… 2001             ""               Inglês
#>  7 COMPLETO In search of me… 2004             ""               Portu…
#>  8 COMPLETO Desafios dos pr… 2003             ""               Portu…
#>  9 COMPLETO Por que reforma… 2003             ""               Portu…
#> 10 COMPLETO Software livre … 2004             ""               Portu…
#> # … with 173 more rows, and 23 more variables: meio.de.divulgacao <chr>,
#> #   home.page.do.trabalho <chr>, flag.relevancia <chr>, doi.x <chr>,
#> #   titulo.do.artigo.ingles <chr>, flag.divulgacao.cientifica <chr>,
#> #   titulo.do.periodico.ou.revista_old <chr>, issn_old <chr>, volume <chr>,
#> #   fasciculo <chr>, serie <chr>, pagina.inicial <chr>, pagina.final <chr>,
#> #   local.de.publicacao <chr>, autores <chr>, autores.citacoes <chr>,
#> #   autores.id <chr>, id <chr>, doi.y <chr>,
#> #   titulo.do.periodico.ou.revista <chr>, issn <chr>, ano.do.artigo <chr>,
#> #   titulo.do.artigo <chr>

Because not every article is DOI-coded, we can still normalize the journal name and ISSN with normalizeByJournal. The result is two new columns added, issn_old and titulo.do.periodico.ou.revista_old that allow us to analyze the results of the substitutions. The more curricula you analyze, the more useful the normalize functions are.

# use explict arguments
nj <- normalizeJournals(pub, issn='issn', journalName='titulo.do.periodico.ou.revista')

# use de defult data frame from getArtigosPublicados
nj <- normalizeJournals(pub)

nj %>>% 
    select(issn_old, issn, titulo.do.periodico.ou.revista_old, titulo.do.periodico.ou.revista) %>>% 
    tail
#> # A tibble: 6 x 4
#>   issn_old issn    titulo.do.periodico.ou.revist… titulo.do.periodico.ou.revista
#>   <chr>    <chr>   <chr>                          <chr>                         
#> 1 23587024 151950… REVISTA DE ESTUDOS SOCIAIS     REVISTA DE ESTUDOS SOCIAIS    
#> 2 24112933 241129… INTERNATIONAL JOURNAL FOR INN… INTERNATIONAL JOURNAL FOR INN…
#> 3 25265539 167916… REVISTA DE ECONOMIA E AGRONEG… REVISTA DE ECONOMIA E AGRONEG…
#> 4 32345234 323452… LIINC em Revista               LIINC em Revista              
#> 5 7891678X 789167… Asset Markets and Acess        Asset Markets and Acess       
#> 6 7891678X 789167… Asset Markets and Acess        Asset Markets and Acess

Finally, if two papers have the same title and were published in the same journal, the year can be normalized with:


# use explict arguments
ny <- normalizeYears(pub, year2normalize='ano.do.artigo',issn='issn',journalName='titulo.do.periodico.ou.revista',paperTitle='titulo.do.artigo')

# use de defult variables names from getArtigosPublicados
ny <- normalizeYears(pub)

ny %>>% 
    select(ano_old, ano, issn, titulo.do.periodico.ou.revista, titulo.do.artigo) %>>% 
    head
#> # A tibble: 6 x 5
#>   ano_old ano   issn    titulo.do.periodico.o… titulo.do.artigo                 
#>   <chr>   <chr> <chr>   <chr>                  <chr>                            
#> 1 1984    1984  ""      Revista Brasileira de… O melhoramento vegetal e os impa…
#> 2 1986    1986  ""      Revista da ANPEC       O programa de estabilização e a …
#> 3 1986    1986  "01041… Cadernos de Ciência &… O desenvolvimento das biotecnolo…
#> 4 1988    1988  ""      Revista Ensaios Econo… Notas sobre a produção de alimen…
#> 5 1988    1988  ""      Temas Rurais           Estrutura agrária e irrigação no…
#> 6 1988    1988  "01032… Revista de Economia e… O desenvolvimento da biotecnolog…

To type less, we can do:

lapply(xmlsLattes, getArtigosPublicados) %>>% 
    bind_rows %>>% 
    as_tibble %>>% 
    normalizeByDoi %>>% 
    normalizeJournals %>>% 
    normalizeYears %>>% 
    select(titulo.do.artigo,ano.do.artigo,issn,titulo.do.periodico.ou.revista,id) %>>% 
    slice(1:10)
#> # A tibble: 10 x 5
#>    titulo.do.artigo             ano.do.artigo issn  titulo.do.periodico… id     
#>    <chr>                        <chr>         <chr> <chr>                <chr>  
#>  1 O melhoramento vegetal e os… 1984          noIS… Revista Brasileira … 498485…
#>  2 O desenvolvimento das biote… 1986          0104… Cadernos de Ciência… 498485…
#>  3 O programa de estabilização… 1986          noIS… Revista da ANPEC     305162…
#>  4 O desenvolvimento da biotec… 1988          0103… Revista de Economia… 498485…
#>  5 Biotecnologia: conceituação… 1988          0103… Texto para Discussã… 498485…
#>  6 Notas sobre a produção de a… 1988          noIS… Revista Ensaios Eco… 305162…
#>  7 Estrutura agrária e irrigaç… 1988          noIS… Temas Rurais         305162…
#>  8 Estrutura agrária e irrigaç… 1988          noIS… Revista de Temas Ru… 498485…
#>  9 Estrutura Agrária e Irrigaç… 1989          0100… Revista Econômica d… 305162…
#> 10 O Plano Nacional de Defensi… 1990          0044… Agricultura em São … 498485…

Merge data

To join the data from different tables the key is the variable id, which is a unique 16 digit code.

lapply(xmlsLattes, getArtigosPublicados) %>>% 
    bind_rows %>>% 
    as_tibble %>>% 
    normalizeByDoi %>>% 
    normalizeJournals %>>% 
    normalizeYears %>>% 
    select(titulo.do.artigo,ano.do.artigo,issn,titulo.do.periodico.ou.revista,id) %>>% 
    left_join( lapply(xmlsLattes, getDadosGerais) %>>% bind_rows %>>% select(id,nome.completo,pais.de.nascimento)) %>>%   
    slice(1:10)
#> # A tibble: 10 x 7
#>    titulo.do.artigo ano.do.artigo issn  titulo.do.perio… id    nome.completo
#>    <chr>            <chr>         <chr> <chr>            <chr> <chr>        
#>  1 O melhoramento … 1984          noIS… Revista Brasile… 4984… Jose Maria F…
#>  2 O desenvolvimen… 1986          0104… Cadernos de Ciê… 4984… Jose Maria F…
#>  3 O programa de e… 1986          noIS… Revista da ANPEC 3051… Antonio Marc…
#>  4 O desenvolvimen… 1988          0103… Revista de Econ… 4984… Jose Maria F…
#>  5 Biotecnologia: … 1988          0103… Texto para Disc… 4984… Jose Maria F…
#>  6 Notas sobre a p… 1988          noIS… Revista Ensaios… 3051… Antonio Marc…
#>  7 Estrutura agrár… 1988          noIS… Temas Rurais     3051… Antonio Marc…
#>  8 Estrutura agrár… 1988          noIS… Revista de Tema… 4984… Jose Maria F…
#>  9 Estrutura Agrár… 1989          0100… Revista Econômi… 3051… Antonio Marc…
#> 10 O Plano Naciona… 1990          0044… Agricultura em … 4984… Jose Maria F…
#> # … with 1 more variable: pais.de.nascimento <chr>