Skip to content

Commit

Permalink
added conferences to output
Browse files Browse the repository at this point in the history
  • Loading branch information
msperlin committed May 16, 2024
1 parent 6aeb54f commit c5d398b
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 2 deletions.
28 changes: 28 additions & 0 deletions R/get_conferences.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
get_conferences <- function(my_xml) {

all_conf <- xml2::xml_find_all(my_xml, ".//APRESENTACAO-DE-TRABALHO")

if (length(all_conf) != 0) {

df_conf <- tibble::tibble()

for (i_node in all_conf) {
conf_dados_basicos <- fetch_df(i_node, ".//DADOS-BASICOS-DA-APRESENTACAO-DE-TRABALHO")

conf_detalhes <- fetch_df(i_node, ".//DETALHAMENTO-DA-APRESENTACAO-DE-TRABALHO")

df_conf <- dplyr::bind_rows(
df_conf,
dplyr::bind_cols(
conf_dados_basicos,
conf_detalhes
)
)
}

} else {
df_conf <- tibble::tibble()
}

return(df_conf)
}
10 changes: 9 additions & 1 deletion R/gld_read_lattes_zip2.R
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,13 @@ gld_read_zip2 <- function(f_zip){
"got {nrow(accepted_papers)} accepted papers"
)

# conference papers
conferences <- get_conferences(my_xml)

cli::cli_alert_success(
"got {nrow(conferences)} conferences"
)

# books ----
books <- get_books(my_xml)

Expand Down Expand Up @@ -111,7 +118,8 @@ gld_read_zip2 <- function(f_zip){
supervisions = superv_all,
at_prof = at_prof,
projects = projs,
coauthors = coauthors
coauthors = coauthors,
conferences = conferences
)

# parse and fix list output
Expand Down
2 changes: 1 addition & 1 deletion vignettes/gld_vignette-ReadLattes.R
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ f <- "~/Desktop/6915544029415506.zip"
l_out <- gld_read_zip2(f)

## -----------------------------------------------------------------------------
dplyr::glimpse(l_out)
dplyr::glimpse(l_out$conferences)

## -----------------------------------------------------------------------------
tpesq <- l.out$tpesq
Expand Down

0 comments on commit c5d398b

Please sign in to comment.