I keeep getting this error every time I try to run the stargazer function and I don't understand. I have uninstalled the package, installed it again, restarted R, uninstalled and installed R.
Error in .stargazer.wrap(..., type = type, title = title, style = style, : could not find function ".stargazer.wrap"
The strangest thing is that stargazer was initially working and then it suddenly started throwing this error, every time I run it, with any type of data. With or without data. An example of data that I have tried:
model <- lm(mpg ~ wt, data = mtcars)
stargazer(model)
Error in .stargazer.wrap(..., type = type, title = title, style = style, :
could not find function ".stargazer.wrap"
I have just realised that when running it like this it does work!
stargazer::stargazer(model, type='text')
library(stargazer)
?library("package name")
at the start of your script. This gives you access to all the functions of that package, in your case the functionstargazer()
. An alternative approach to accessing functions from packages which are installed on your computer but not loaded into the script is to use the double colon notation "package name"::"function name"; in your case:stargazer::stargazer()