我需要在 R 腳本中使用以下 bash 命令(或等效命令)。理想情況下,我需要將輸出捕獲到一個變數中
curl -LH“接受:文本/參考書目;樣式=bibtex” https://doi.org/10.1002/cbin.11105
我檢查了 httr 庫,但我沒有運氣。此外,我嘗試將命令嵌入到系統呼叫中,但使用選項“intern = TRUE”時很難決議輸出。提前致謝
uj5u.com熱心網友回復:
library(httr)
res <- GET("https://doi.org/10.1002/cbin.11105", accept("text/bibliography; style=bibtex"))
res
# Response [https://api.crossref.org/v1/works/10.1002/cbin.11105/transform]
# Date: 2022-03-18 19:21
# Status: 200
# Content-Type: text/bibliography
# Size: 475 B
# @article{2019, title={Silencing of MEG3 inhibited ox-LDL-induced inflammation and apoptosis in macrophages via ...
(注意Status: 200以確保它成功。)
content(res)
# No encoding supplied: defaulting to UTF-8.
# [1] " @article{2019, title={Silencing of MEG3 inhibited ox-LDL-induced inflammation and apoptosis in macrophages via modulation of the MEG3/miR-204/CDKN2A regulatory axis}, volume={43}, ISSN={1095-8355}, url={http://dx.doi.org/10.1002/cbin.11105}, DOI={10.1002/cbin.11105}, number={4}, journal={Cell Biology International}, publisher={Wiley}, author={Yan, Long and Liu, Zhanchuan and Yin, Haoyuan and Guo, Zhenjie and Luo, Qi}, year={2019}, month={Feb}, pages={409?420} }\n"
轉載請註明出處,本文鏈接:https://www.uj5u.com/ruanti/448106.html
