Skip to content

Commit c5d398b

Browse files
committed
added conferences to output
1 parent 6aeb54f commit c5d398b

File tree

3 files changed

+38
-2
lines changed

3 files changed

+38
-2
lines changed

R/get_conferences.R

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
get_conferences <- function(my_xml) {
2+
3+
all_conf <- xml2::xml_find_all(my_xml, ".//APRESENTACAO-DE-TRABALHO")
4+
5+
if (length(all_conf) != 0) {
6+
7+
df_conf <- tibble::tibble()
8+
9+
for (i_node in all_conf) {
10+
conf_dados_basicos <- fetch_df(i_node, ".//DADOS-BASICOS-DA-APRESENTACAO-DE-TRABALHO")
11+
12+
conf_detalhes <- fetch_df(i_node, ".//DETALHAMENTO-DA-APRESENTACAO-DE-TRABALHO")
13+
14+
df_conf <- dplyr::bind_rows(
15+
df_conf,
16+
dplyr::bind_cols(
17+
conf_dados_basicos,
18+
conf_detalhes
19+
)
20+
)
21+
}
22+
23+
} else {
24+
df_conf <- tibble::tibble()
25+
}
26+
27+
return(df_conf)
28+
}

R/gld_read_lattes_zip2.R

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,13 @@ gld_read_zip2 <- function(f_zip){
6262
"got {nrow(accepted_papers)} accepted papers"
6363
)
6464

65+
# conference papers
66+
conferences <- get_conferences(my_xml)
67+
68+
cli::cli_alert_success(
69+
"got {nrow(conferences)} conferences"
70+
)
71+
6572
# books ----
6673
books <- get_books(my_xml)
6774

@@ -111,7 +118,8 @@ gld_read_zip2 <- function(f_zip){
111118
supervisions = superv_all,
112119
at_prof = at_prof,
113120
projects = projs,
114-
coauthors = coauthors
121+
coauthors = coauthors,
122+
conferences = conferences
115123
)
116124

117125
# parse and fix list output

vignettes/gld_vignette-ReadLattes.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ f <- "~/Desktop/6915544029415506.zip"
1919
l_out <- gld_read_zip2(f)
2020

2121
## -----------------------------------------------------------------------------
22-
dplyr::glimpse(l_out)
22+
dplyr::glimpse(l_out$conferences)
2323

2424
## -----------------------------------------------------------------------------
2525
tpesq <- l.out$tpesq

0 commit comments

Comments
 (0)