问题
I'm making a personal package and would like to load a css file in one of the functions in this package in order to have a "default style". What is the optimal way of doing this?
I cannot find any documnetation that helps me understand how to work with external data like a css file, mostly what I find is about exporting external datasets to be loaded separately, etc.
回答1:
I found the problem. I was using the inst/extdata folder to export my style.css file, but was trying to read it directly in the code. Thanks to @MrFlick docpage, I found out I had to use the system.file()
function in order to use the exported file.
来源:https://stackoverflow.com/questions/53784766/how-to-add-css-external-files-to-be-used-by-my-r-package-function