How to Solve Stargazer Error Asking For. Stargazer. Wrap Function

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')
5
Sarah Jenkins

Sarah Jenkins

Senior Technology Editor & AI Specialist

Sarah Jenkins is a veteran tech journalist with over 12 years of experience covering artificial intelligence, mobile innovations, and digital ethics. Her insights have appeared in leading technology publications worldwide.

Share this article