我正在尝试运行以下代码:
library(WikipediR)
wp_content <- page_content("en","wikipedia",page_name = "Aaron Halfaker",as_wikitext = T,clean_response = T)
wp_content <- wp_content$wikitext$`*`
print(wp_content)
但是输出在Wiki标记中:
[1] "{{Infobox scientist\n| name = Aaron Halfaker\n| native_name = \n| native_name_lang = \n| image = File:Halfaker,_Aaron_Sept_2013.jpg\n| image_size = \n| alt = \n| caption = \n| birth_date = {{birth date and age|1983|12|27}}\n| birth_place = [[Virginia,Minnesota]]<ref>{{Cite web |url=https://twitter.com/halfak/status/826529576906059780 |title=Twitter status |last=Halfaker |first=Aaron |website=Twitter |date=31 January 2017}}</ref>\n| death_date = \n| death_place = \n| resting_place = \n| resting_place_coordinates = <!--{{coord|LAT|LONG|type:landmark|display=inline,title}}-->\n| other_names = \n| residence = \n| citizenship = \n| nationality = \n| fields = [[Human-Computer Interaction]] <br/> [[computer-supported cooperative work]]\n| workplaces = [[Wikimedia Foundation]]\n| patrons = \n| alma_mater = [[The College of St. Scholastica]] (B.S.,2006)<br/> [[University of Minnesota]] (Ph.D.,2013)<ref name=\"tmn\">{{cite web|url=http://tech.mn/news/2013/12/11/aaron-halfaker-wikimedia-foundation/|title=Wicked Smart: 5 questions with U of M PhD and Wikipedian Aaron Halfaker|date=11 December 2013|publisher=TechMN|accessdate=5 January 2015}}</ref><ref>{{Cite web |url=https://www-users.cs.umn.edu/~halfak/docs/curriculum_vitae |title=Aaron Halfaker Curriculum Vitae}}</ref>\n..."
如何将其转换为纯文本,或立即将其转换为纯文本。
我也尝试通过as_wiktext = F
,但没有成功。
语言-R。 软件包-Wikipedir v1.5.0