使用rscopus提取书目信息

时间:2018-06-22 08:24:37

标签: r

我正在尝试使用rscopus软件包从scopus中提取author_id数据。我有一个员工first_name和last_name的大型数据框(dataframe = people_rank)。我尝试遍历people_rank以提取last_name,first_name和affil_id的相应author_id。

首先,我创建一个具有单个条目的author_id数据框:

author_inf <- as.data.frame(get_complete_author_info(last_name = people_rank$LastName[1], first_name = people_rank$FirstName[1], affil_id = "60029470", api_key = APIkey)[[2]])

然后我只选择我感兴趣的那些列:

author_id <- author_inf %>% select(search.results.entry.dc.identifier, search.results.entry.preferred.name.surname, search.results.entry.preferred.name.given.name)

然后我遍历people_rank:

for(i in 2:nrow(people_rank)){
  eval(parse(text = paste0('a_inf <- as.data.frame(get_complete_author_info(last_name = people_rank$LastName[',i,'], first_name = people_rank$FirstName[',i,'], affil_id = "60029470", api_key = APIkey)[[2]])')))
  if(length(a_inf) == 12){
    next
  }
  author_id <- a_inf %>% select(search.results.entry.dc.identifier, search.results.entry.preferred.name.surname, search.results.entry.preferred.name.given.name) %>%
bind_rows(author_id)
} 

这很好,但随后出现此错误消息:

Error in (function (..., row.names = NULL, check.rows = FALSE, check.names = TRUE,  : 
  arguments imply differing number of rows: 1, 0
In addition: There were 50 or more warnings (use warnings() to see the first 50)

我的people_rank数据框是一个整齐的数据集。有些名称是不寻常的,例如first_name =“ C.H-”,last_name =“ Chung”或first_name =“ Bob”,last_name =“ Pilkington-Smythe”。任何想法可能是什么原因造成的?

0 个答案:

没有答案