1414# ' references_df <- create_df_from_endnote_xml()
1515# ' head(references_df)
1616# '
17- create_df_from_endnote_xml <- function (endnote_xml = default_xml()) {
17+ create_df_from_endnote_xml <- function (endnote_xml = default_xml())
18+ {
1819 references <- kwb.read :: read_xml_as_path_value(endnote_xml )
1920
2021 xml_paths <- references $ path %> %
2122 stringr :: str_remove_all(pattern = " ^/xml/records/record" )
2223
2324 references_df <- kwb.utils :: asNoFactorDataFrame(cbind(
2425 kwb.file :: to_subdir_matrix(xml_paths ),
25- references [, - 1 ]
26+ references [, - 1L ]
2627 ))
2728
28- references_df [, 1 ] <- as.numeric(stringr :: str_remove_all(
29- references_df [, 1 ], " \\ [|\\ ]"
29+ references_df [, 1L ] <- as.numeric(stringr :: str_remove_all(
30+ references_df [, 1L ], " \\ [|\\ ]"
3031 ))
3132
3233 n_col <- ncol(references_df )
3334
34- colnames(references_df ) <- c(" record_id" , paste0(" key" , 1 : (n_col - 2 )), " value" )
35+ colnames(references_df ) <- c(
36+ " record_id" ,
37+ paste0(" key" , seq_len(n_col - 2L )),
38+ " value"
39+ )
3540
3641 endnote_df <- dplyr :: left_join(
3742 references_df ,
@@ -41,7 +46,8 @@ create_df_from_endnote_xml <- function(endnote_xml = default_xml()) {
4146 add_file_info_attributes(endnote_df , endnote_xml )
4247}
4348
44- if (FALSE ) {
49+ if (FALSE )
50+ {
4551 abstracts <- references_df %> %
4652 dplyr :: filter(.data $ key1 == " abstract" ) %> %
4753 dplyr :: group_by(
0 commit comments