Skip to content

Commit

Permalink
.getCharacter to getCharacter datasets compress
Browse files Browse the repository at this point in the history
  • Loading branch information
roneyfraga committed May 2, 2020
1 parent d8d272e commit 5508480
Show file tree
Hide file tree
Showing 42 changed files with 125 additions and 118 deletions.
1 change: 1 addition & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@
^pkgdown$
^doc$
^Meta$
^CRAN-RELEASE$
2 changes: 2 additions & 0 deletions CRAN-RELEASE
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
This package was submitted to CRAN on 2020-05-02.
Once it is accepted, delete this file and tag the release (commit d8d272edfd).
2 changes: 2 additions & 0 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,5 @@ Imports:
rlist,
stringr,
stringi
Depends:
R (>= 2.10)
2 changes: 2 additions & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,11 @@ importFrom(dplyr,arrange)
importFrom(dplyr,bind_cols)
importFrom(dplyr,bind_rows)
importFrom(dplyr,group_by)
importFrom(dplyr,left_join)
importFrom(dplyr,mutate)
importFrom(dplyr,mutate_if)
importFrom(dplyr,rename)
importFrom(dplyr,select)
importFrom(dplyr,ungroup)
importFrom(pipeR,"%>>%")
importFrom(rlang,.data)
Expand Down
2 changes: 1 addition & 1 deletion R/datasets.R
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#' @title Lattes XMLs list for tests
#'
#' @description 500 Lattes XML curricula imported as list.
#' @description 500 random Lattes XML curricula imported as list.
#' @docType data
#' @usage xmlsLattes
#' @format list
Expand Down
8 changes: 4 additions & 4 deletions R/getApresentacaoTrabalho.R
Original file line number Diff line number Diff line change
Expand Up @@ -43,18 +43,18 @@ getApresentacaoTrabalho <- function(curriculo){
if(any( names(x) %in% 'DADOS-BASICOS-DA-APRESENTACAO-DE-TRABALHO')){


ll4 <- bind_cols(.getCharacter(x$`DADOS-BASICOS-DA-APRESENTACAO-DE-TRABALHO`) ,
ll4 <- bind_cols(getCharacter(x$`DADOS-BASICOS-DA-APRESENTACAO-DE-TRABALHO`) ,

if(any(names(x) %in% 'DETALHAMENTO-DA-APRESENTACAO-DE-TRABALHO')){
if(length(x$`DETALHAMENTO-DA-APRESENTACAO-DE-TRABALHO`) != 0){
.getCharacter(x$`DETALHAMENTO-DA-APRESENTACAO-DE-TRABALHO`)
getCharacter(x$`DETALHAMENTO-DA-APRESENTACAO-DE-TRABALHO`)
}
}
)

a <- which(names(x) == "AUTORES" )

autores <- lapply(a, function(z){ .getCharacter(x[[z]]) })
autores <- lapply(a, function(z){ getCharacter(x[[z]]) })

autores1 <- data.frame(autores = "", autores.citacoes ="", autores.id="")

Expand Down Expand Up @@ -86,7 +86,7 @@ getApresentacaoTrabalho <- function(curriculo){
}
}

id1 <- .getCharacter(curriculo$id)
id1 <- getCharacter(curriculo$id)
names(id1) <- "id"
ll6 <- bind_cols(ll4,autores1,id1)

Expand Down
2 changes: 1 addition & 1 deletion R/getAreasAtuacao.R
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ getAreasAtuacao <- function(curriculo){
if(!is.null(ll2)){

if(length(ll2)>=1){
arat <- lapply(ll2, function(x){ if(!is.null(x)){ .getCharacter(x)} } )
arat <- lapply(ll2, function(x){ if(!is.null(x)){ getCharacter(x)} } )
arat <- bind_rows(arat)
}
arat$id <- curriculo$id
Expand Down
8 changes: 4 additions & 4 deletions R/getArtigosPublicados.R
Original file line number Diff line number Diff line change
Expand Up @@ -35,17 +35,17 @@ getArtigosPublicados <- function(curriculo){

ll3 <- lapply(g, function(x){

ll4 <- bind_cols( .getCharacter(ll2[[x]]$`DADOS-BASICOS-DO-ARTIGO`),
ll4 <- bind_cols( getCharacter(ll2[[x]]$`DADOS-BASICOS-DO-ARTIGO`),
if(any( names(ll2[[x]]) %in% 'DETALHAMENTO-DO-ARTIGO') ){
if(length(ll2[[x]]$`DETALHAMENTO-DO-ARTIGO`) != 0){
.getCharacter(ll2[[x]]$`DETALHAMENTO-DO-ARTIGO`)
getCharacter(ll2[[x]]$`DETALHAMENTO-DO-ARTIGO`)
}
}
)

a <- which(names(ll2[[x]]) == "AUTORES" )

autores <- lapply(a, function(z){ .getCharacter(ll2[[x]][[z]]) })
autores <- lapply(a, function(z){ getCharacter(ll2[[x]][[z]]) })

autores1 <- data.frame(autores = "", autores.citacoes ="", autores.id="")

Expand Down Expand Up @@ -77,7 +77,7 @@ getArtigosPublicados <- function(curriculo){
}
}

id1 <- .getCharacter(curriculo$id)
id1 <- getCharacter(curriculo$id)
names(id1) <- "id"

ll6 <- bind_cols(ll4, autores1, id1)
Expand Down
8 changes: 4 additions & 4 deletions R/getAtuacoesProfissionais.R
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@ getAtuacoesProfissionais <- function(curriculo){
if(qtde==1){

attrs <- if(!any(names(ll2) %in% '.attrs') & any(names(ll2[[1]]) %in% '.attrs')){
.getCharacter(ll2[[1]][['.attrs']])
getCharacter(ll2[[1]][['.attrs']])
} else{
.getCharacter(ll2[[1]])
getCharacter(ll2[[1]])
}
atv <- names(ll2[[1]])
atv <- str_c(atv, collapse=',')
Expand All @@ -46,9 +46,9 @@ getAtuacoesProfissionais <- function(curriculo){

attrs <- lapply(ll2, function(x){
if(any(names(x) %in% '.attrs')){
.getCharacter(x[['.attrs']])
getCharacter(x[['.attrs']])
} else{
.getCharacter(x)
getCharacter(x)
}
})

Expand Down
8 changes: 4 additions & 4 deletions R/getBancasDoutorado.R
Original file line number Diff line number Diff line change
Expand Up @@ -38,17 +38,17 @@ getBancasDoutorado <- function(curriculo){

if(any( names(x) %in% 'DADOS-BASICOS-DA-PARTICIPACAO-EM-BANCA-DE-DOUTORADO')){

ll4 <- bind_cols(.getCharacter(x$`DADOS-BASICOS-DA-PARTICIPACAO-EM-BANCA-DE-DOUTORADO`),
ll4 <- bind_cols(getCharacter(x$`DADOS-BASICOS-DA-PARTICIPACAO-EM-BANCA-DE-DOUTORADO`),
if(any(names(x) %in% 'DETALHAMENTO-DA-PARTICIPACAO-EM-BANCA-DE-DOUTORADO')){
if(length(x$`DETALHAMENTO-DA-PARTICIPACAO-EM-BANCA-DE-DOUTORADO`) != 0){
.getCharacter(x$`DETALHAMENTO-DA-PARTICIPACAO-EM-BANCA-DE-DOUTORADO`)
getCharacter(x$`DETALHAMENTO-DA-PARTICIPACAO-EM-BANCA-DE-DOUTORADO`)
}
}
)

a <- which(names(x) == "PARTICIPANTE-BANCA" )

autores <- lapply(a, function(z){ .getCharacter(x[[z]]) })
autores <- lapply(a, function(z){ getCharacter(x[[z]]) })

autores1 <- data.frame(autores = "", autores.citacoes ="", autores.id="")

Expand Down Expand Up @@ -80,7 +80,7 @@ getBancasDoutorado <- function(curriculo){
}
}

id1 <- .getCharacter(curriculo$id)
id1 <- getCharacter(curriculo$id)
names(id1) <- "id"
ll6 <- bind_cols(ll4, autores1, id1)

Expand Down
8 changes: 4 additions & 4 deletions R/getBancasGraduacao.R
Original file line number Diff line number Diff line change
Expand Up @@ -38,18 +38,18 @@ getBancasGraduacao <- function(curriculo){

if(any( names(x) %in% 'DADOS-BASICOS-DA-PARTICIPACAO-EM-BANCA-DE-GRADUACAO')){

ll4 <- bind_cols(.getCharacter(x$`DADOS-BASICOS-DA-PARTICIPACAO-EM-BANCA-DE-GRADUACAO`),
ll4 <- bind_cols(getCharacter(x$`DADOS-BASICOS-DA-PARTICIPACAO-EM-BANCA-DE-GRADUACAO`),
if(any(names(x) %in% 'DETALHAMENTO-DA-PARTICIPACAO-EM-BANCA-DE-GRADUACAO')){
if(length(x$`DETALHAMENTO-DA-PARTICIPACAO-EM-BANCA-DE-GRADUACAO`) != 0){
.getCharacter(x$`DETALHAMENTO-DA-PARTICIPACAO-EM-BANCA-DE-GRADUACAO`)
getCharacter(x$`DETALHAMENTO-DA-PARTICIPACAO-EM-BANCA-DE-GRADUACAO`)
}
}

)

a <- which(names(x) == "PARTICIPANTE-BANCA" )

autores <- lapply(a, function(z){ .getCharacter(x[[z]]) })
autores <- lapply(a, function(z){ getCharacter(x[[z]]) })

autores1 <- data.frame(autores = "", autores.citacoes ="", autores.id="")

Expand Down Expand Up @@ -81,7 +81,7 @@ getBancasGraduacao <- function(curriculo){
}
}

id1 <- .getCharacter(curriculo$id)
id1 <- getCharacter(curriculo$id)
names(id1) <- "id"
ll6 <- bind_cols(ll4, autores1, id1)

Expand Down
8 changes: 4 additions & 4 deletions R/getBancasJulgadoras.R
Original file line number Diff line number Diff line change
Expand Up @@ -51,17 +51,17 @@ getBancasJulgadoras <- function(curriculo){
}


ll4 <- bind_cols( .getCharacter(ll2[[x]][[db]]),
ll4 <- bind_cols( getCharacter(ll2[[x]][[db]]),
if(any( names(ll2[[x]]) %in% partet) ){
if(length(ll2[[x]][[dt]]) != 0){
.getCharacter(ll2[[x]][[dt]])
getCharacter(ll2[[x]][[dt]])
}
}
)

a <- which(names(ll2[[x]]) == "PARTICIPANTE-BANCA" )

autores <- lapply(a, function(z){ .getCharacter(ll2[[x]][[z]]) })
autores <- lapply(a, function(z){ getCharacter(ll2[[x]][[z]]) })

autores1 <- data.frame(autores = "", autores.citacoes ="", autores.id="")

Expand Down Expand Up @@ -93,7 +93,7 @@ getBancasJulgadoras <- function(curriculo){
}
}

id1 <- .getCharacter(curriculo$id)
id1 <- getCharacter(curriculo$id)
names(id1) <- "id"
ll6 <- bind_cols(ll4, autores1, id1)

Expand Down
8 changes: 4 additions & 4 deletions R/getBancasMestrado.R
Original file line number Diff line number Diff line change
Expand Up @@ -38,17 +38,17 @@ getBancasMestrado <- function(curriculo){

if(any( names(x) %in% 'DADOS-BASICOS-DA-PARTICIPACAO-EM-BANCA-DE-MESTRADO')){

ll4 <- bind_cols(.getCharacter(x$`DADOS-BASICOS-DA-PARTICIPACAO-EM-BANCA-DE-MESTRADO`),
ll4 <- bind_cols(getCharacter(x$`DADOS-BASICOS-DA-PARTICIPACAO-EM-BANCA-DE-MESTRADO`),
if(any(names(x) %in% 'DETALHAMENTO-DA-PARTICIPACAO-EM-BANCA-DE-MESTRADO')){
if(length(x$`DETALHAMENTO-DA-PARTICIPACAO-EM-BANCA-DE-MESTRADO`) != 0){
.getCharacter(x$`DETALHAMENTO-DA-PARTICIPACAO-EM-BANCA-DE-MESTRADO`)
getCharacter(x$`DETALHAMENTO-DA-PARTICIPACAO-EM-BANCA-DE-MESTRADO`)
}
}
)

a <- which(names(x) == "PARTICIPANTE-BANCA" )

autores <- lapply(a, function(z){ .getCharacter(x[[z]]) })
autores <- lapply(a, function(z){ getCharacter(x[[z]]) })

autores1 <- data.frame(autores = "", autores.citacoes ="", autores.id="")

Expand Down Expand Up @@ -80,7 +80,7 @@ getBancasMestrado <- function(curriculo){
}
}

id1 <- .getCharacter(curriculo$id)
id1 <- getCharacter(curriculo$id)
names(id1) <- "id"
ll6 <- bind_cols(ll4, autores1, id1)

Expand Down
8 changes: 4 additions & 4 deletions R/getCapitulosLivros.R
Original file line number Diff line number Diff line change
Expand Up @@ -37,18 +37,18 @@ getCapitulosLivros <- function(curriculo){

ll3 <- lapply(ll2, function(x){

ll4 <- bind_cols(.getCharacter(x$`DADOS-BASICOS-DO-CAPITULO`) ,
ll4 <- bind_cols(getCharacter(x$`DADOS-BASICOS-DO-CAPITULO`) ,

if(any(names(x) %in% 'DETALHAMENTO-DO-CAPITULO')){
if(length(x$`DETALHAMENTO-DO-CAPITULO`) != 0){
.getCharacter(x$`DETALHAMENTO-DO-CAPITULO`)
getCharacter(x$`DETALHAMENTO-DO-CAPITULO`)
}
}
)

a <- which(names(x) == "AUTORES" )

autores <- lapply(a, function(z){ .getCharacter(x[[z]]) })
autores <- lapply(a, function(z){ getCharacter(x[[z]]) })

autores1 <- data.frame(autores = "", autores.citacoes ="", autores.id="")

Expand Down Expand Up @@ -80,7 +80,7 @@ getCapitulosLivros <- function(curriculo){
}
}

id1 <- .getCharacter(curriculo$id)
id1 <- getCharacter(curriculo$id)
names(id1) <- "id"
ll6 <- bind_cols(ll4,autores1,id1)

Expand Down
8 changes: 4 additions & 4 deletions R/getCursoCurtaDuracao.R
Original file line number Diff line number Diff line change
Expand Up @@ -39,18 +39,18 @@ getCursoCurtaDuracao <- function(curriculo){
if(any( names(x) %in% 'DADOS-BASICOS-DE-CURSOS-CURTA-DURACAO-MINISTRADO')){


ll4 <- bind_cols(.getCharacter(x$`DADOS-BASICOS-DE-CURSOS-CURTA-DURACAO-MINISTRADO`) ,
ll4 <- bind_cols(getCharacter(x$`DADOS-BASICOS-DE-CURSOS-CURTA-DURACAO-MINISTRADO`) ,

if(any(names(x) %in% 'DETALHAMENTO-DE-CURSOS-CURTA-DURACAO-MINISTRADO')){
if(length(x$`DETALHAMENTO-DE-CURSOS-CURTA-DURACAO-MINISTRADO`) != 0){
.getCharacter(x$`DETALHAMENTO-DE-CURSOS-CURTA-DURACAO-MINISTRADO`)
getCharacter(x$`DETALHAMENTO-DE-CURSOS-CURTA-DURACAO-MINISTRADO`)
}
}
)

a <- which(names(x) == "AUTORES" )

autores <- lapply(a, function(z){ .getCharacter(x[[z]]) })
autores <- lapply(a, function(z){ getCharacter(x[[z]]) })

autores1 <- data.frame(autores = "", autores.citacoes ="", autores.id="")

Expand Down Expand Up @@ -82,7 +82,7 @@ getCursoCurtaDuracao <- function(curriculo){
}
}

id1 <- .getCharacter(curriculo$id)
id1 <- getCharacter(curriculo$id)
names(id1) <- "id"
ll6 <- bind_cols(ll4,autores1,id1)

Expand Down
2 changes: 1 addition & 1 deletion R/getDadosGerais.R
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ getDadosGerais <- function(curriculo){
ll <- curriculo$`DADOS-GERAIS`
if(any('NOME-COMPLETO' %in% names(ll$.attrs))){
if(length(ll)>1){
dados.gerais <- .getCharacter(ll$.attrs)
dados.gerais <- getCharacter(ll$.attrs)
dados.gerais$id <- curriculo$id
dados.gerais$data.atualizacao <- curriculo$.attrs[['DATA-ATUALIZACAO']]
dados.gerais <- mutate_if(dados.gerais, is.factor, as.character)
Expand Down
8 changes: 4 additions & 4 deletions R/getEventosCongressos.R
Original file line number Diff line number Diff line change
Expand Up @@ -52,17 +52,17 @@ getEventosCongressos <- function(curriculo){
}


ll4 <- bind_cols( .getCharacter(ll2[[x]][[db]]),
ll4 <- bind_cols( getCharacter(ll2[[x]][[db]]),
if(any( names(ll2[[x]]) %in% partet) ){
if(length(ll2[[x]][[dt]]) != 0){
.getCharacter(ll2[[x]][[dt]])
getCharacter(ll2[[x]][[dt]])
}
}
)

a <- which(names(ll2[[x]]) == "PARTICIPANTE-DE-EVENTOS-CONGRESSOS" )

autores <- lapply(a, function(z){ .getCharacter(ll2[[x]][[z]]) })
autores <- lapply(a, function(z){ getCharacter(ll2[[x]][[z]]) })

autores1 <- data.frame(autores = "", autores.citacoes ="", autores.id="")

Expand Down Expand Up @@ -94,7 +94,7 @@ getEventosCongressos <- function(curriculo){
}
}

id1 <- .getCharacter(curriculo$id)
id1 <- getCharacter(curriculo$id)
names(id1) <- "id"
ll6 <- bind_cols(ll4, autores1, id1)

Expand Down
2 changes: 1 addition & 1 deletion R/getFormacao.R
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ getFormacao <- function(curriculo){
ll <- ll$`FORMACAO-ACADEMICA-TITULACAO`

if(!is.null(ll)){
formacao <- lapply(ll, function(x){ if(!is.null(x)){ .getCharacter(x)} } )
formacao <- lapply(ll, function(x){ if(!is.null(x)){ getCharacter(x)} } )
formacao$id <- curriculo$id
return(formacao)
}else{
Expand Down
2 changes: 1 addition & 1 deletion R/getIdiomas.R
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ getIdiomas <- function(curriculo){
ll <- ll$`IDIOMAS`

if(length(ll) >=1){
idm <- lapply(ll, function(x){ if(!is.null(x)){ .getCharacter(x)} } )
idm <- lapply(ll, function(x){ if(!is.null(x)){ getCharacter(x)} } )
idm <- bind_rows(idm)
}
idm$id <- curriculo$id
Expand Down
8 changes: 4 additions & 4 deletions R/getJornaisRevistas.R
Original file line number Diff line number Diff line change
Expand Up @@ -35,19 +35,19 @@ getJornaisRevistas <- function(curriculo){

ll3 <- lapply(ll2, function(x){

ll4 <- bind_cols(.getCharacter(x$`DADOS-BASICOS-DO-TEXTO`) ,
ll4 <- bind_cols(getCharacter(x$`DADOS-BASICOS-DO-TEXTO`) ,

if(any(names(x) %in% 'DETALHAMENTO-DO-TEXTO')){
if(length(x$`DETALHAMENTO-DO-TEXTO`) != 0){
.getCharacter(x$`DETALHAMENTO-DO-TEXTO`)
getCharacter(x$`DETALHAMENTO-DO-TEXTO`)
}
}

)

a <- which(names(x) == "AUTORES" )

autores <- lapply(a, function(z){ .getCharacter(x[[z]]) })
autores <- lapply(a, function(z){ getCharacter(x[[z]]) })

autores1 <- data.frame(autores = "", autores.citacoes ="", autores.id="")

Expand Down Expand Up @@ -79,7 +79,7 @@ getJornaisRevistas <- function(curriculo){
}
}

id1 <- .getCharacter(curriculo$id)
id1 <- getCharacter(curriculo$id)
names(id1) <- "id"

ll6 <- bind_cols(ll4,autores1,id1)
Expand Down
Loading

0 comments on commit 5508480

Please sign in to comment.