muschellij2 / rscopus

Scopus Database API Interface to R
76 stars 16 forks source link

Non-character argument error applying bibtex_core_data() #33

Closed mb451 closed 4 years ago

mb451 commented 4 years ago

Hi -

I get the following error when applying bibtex_core_data() to the output of article_retrieval().

"Error in strsplit(title, " ") : non-character argument."

Bibtex_core_data() appears to have executed successfully.

Let me know what I can provide to help and appreciate any attention you might have for this!

muschellij2 commented 4 years ago

Please create a MCVE: https://stackoverflow.com/help/minimal-reproducible-example

mb451 commented 4 years ago

temp <- article_retrieval("10.1016/j.apenergy.2018.10.016", identifier = "doi") bibtex_core_data(temp)

muschellij2 commented 4 years ago

Use abstract_retrieval not article_retrieval.

mb451 commented 4 years ago

Thanks.

bibtex_core_data executes on output of abstract_retrieval but returns the character "@article{}."

Am I missing something else?

muschellij2 commented 4 years ago

Need to install the new rscopus to get the full output from article_retrieval, but abstract_retrieval for me gives full output:

library(rscopus)
temp <- article_retrieval("10.1016/j.apenergy.2018.10.016", identifier = "doi")
#> HTTP specified is:https://api.elsevier.com/content/article/doi/10.1016/j.apenergy.2018.10.016
result = bibtex_core_data(temp)
#> Warning in bibtex_core_data(temp): Authors are NULL, output should be from
#> abstract_retrieval? Author list may not be right!
cat(result, sep = "\n")
#> @article{Cai2019A2005,
#> author = {Bofeng Cai and Jun Lu and Jinnan Wang and Huijuan Dong and Xiaoman Liu and Yang Chen and Zhanming Chen and Jianhui Cong and Zhipeng Cui and Chunyan Dai and Kai Fang and Tong Feng and Jie Guo and Fen Li and Fanxin Meng and Wei Tang and Gengzhe Wang and Yunsheng Xie and Jianjun Zhang},
#> address = {},
#> title = {A benchmark city-level carbon dioxide emission inventory for China in 2005 },
#> journal = {Applied Energy},
#> year = {2019},
#> volume = {233},
#> number = {},
#> pages = {659-673},
#> doi = {10.1016/j.apenergy.2018.10.016}
#> abstract = {}}

temp <- abstract_retrieval("10.1016/j.apenergy.2018.10.016", identifier = "doi")
#> HTTP specified is:https://api.elsevier.com/content/abstract/doi/10.1016/j.apenergy.2018.10.016
result = bibtex_core_data(temp)
cat(result, sep = "\n")
#> @article{Cai2019A2005,
#> author = {Bofeng Cai and Jun Lu and Jinnan Wang and Huijuan Dong and Xiaoman Liu and Yang Chen and Zhanming Chen and Jianhui Cong and Zhipeng Cui and Chunyan Dai and Kai Fang and Tong Feng and Jie Guo and Fen Li and Fanxin Meng and Wei Tang and Gengzhe Wang and Yunsheng Xie and Jianjun Zhang},
#> address = {Zhejiang University Environmental and Energy Policy Research Center; School of Public Affairs, Zhejiang University; Dongguan University of Technology; Technische Universiteit Eindhoven; Shanghai University of Finance and Economics; Shanghai Jiao Tong University; Nanjing Agricultural University; Tianjin University; Chongqing Technology and Business University; Institute of Atmospheric Physics Chinese Academy of Sciences; Renmin University of China; China University of Geosciences, Beijing; Shanxi University; Consulting Department of E20 Environment Platform; CityU Shenzhen Research Institute; Chinese Academy for Environmental Planning; Jiangxi Academy of Sciences},
#> title = {A benchmark city-level carbon dioxide emission inventory for China in 2005},
#> journal = {Applied Energy},
#> year = {2019},
#> volume = {233-234},
#> number = {},
#> pages = {659-673},
#> doi = {10.1016/j.apenergy.2018.10.016}
#> abstract = {© 2018 Elsevier LtdYear 2005 is important because it is the base year for the international carbon reduction commitment and national development plans for China. However, accurate and robust CO2 emission data for 2005 remain limited, particularly for city-level emissions. To address these gaps, we established a uniform city-level CO2 emission inventory for all the 287 prefecture-level cities in China for 2005, combining the High-Resolution Emission Gridded Database (CHRED) 2.0, statistical data and onsite survey. The results showed that Shanghai, Tangshan, Beijing, Tianjin, Jining, Handan, Chongqing, Suzhou, Shijiazhuang and Wuhan were the ten cities with greatest CO2 emissions in 2005, with total CO2 emissions of 205, 184, 145, 126, 116, 103, 96, 93, 90 and 81 Mt, respectively. These cities were either megacities or those dominated by coal, iron or steel production. However, the three cities with the highest CO2 emissions per GDP and CO2 emissions per capita were Jiayuguan, Wuhai and Shizuishan, which were dominated by industry, small- or medium-sized, and exhibited a high demand for heat and cooling. Cluster analysis revealed that industrial energy consumption was the dominant emission source for most cities, except Haikou and Lhasa, for which indirect CO2 emissions were dominant. This study will greatly contribute to the city level CO2 emission inventory and research on China.}}

Created on 2020-03-23 by the reprex package (v0.3.0)

muschellij2 commented 4 years ago

This works right now - so please reopen if not working.