How do I tell which R packages to cite in my paper?

余生长醉 提交于 2019-12-13 19:59:49

问题


The question of R "stats" citation for a scientific paper makes me wonder how I would enumerate all the R packages that I ought to cite when using R in an academic paper. How would I get a list of packages that I loaded and need citation?


回答1:


Using the answer to How to find out which package version is loaded in R? , I see that we can use the sessionInfo() function to see what packages have been loaded (though not necessarily used).

The following gets the base packages as a vector and concatenates it with the names of the loaded packages. Then we apply the citation function to each.

packages_in_use <- c( sessionInfo()$basePkgs, names( sessionInfo()$loadedOnly ) )
the_citations_list <- lapply( X=packages_in_use, FUN=citation)
the_citations_list 


来源:https://stackoverflow.com/questions/27535628/how-do-i-tell-which-r-packages-to-cite-in-my-paper

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!