Got this error trying to run library(mosaic)

Hey everyone, for my R Studio coding class I am trying to run this set of code:


This is the error message I receive when it reaches the library(mosaic) line:

Error: package or namespace load failed for ‘mosaic’: .onLoad failed in loadNamespace() for 'broom', details: call: loadNamespace(name) error: there is no package called ‘backports’

Any help would be appreciated, thanks!



I ran that line of code which subsequently installed the package and still received the same error as above when trying to run my lines of code.

That suggests the package has not been successfully installed, Can you show the complete output you get when you run this command?

1 Like

I think I just figured it out; when I ran the install.packages("backports") command, it prompted me to install from sources the package which needs compilation. This time instead of choosing 'yes', I chose 'no' and that seems to have allowed my code to run fully.
Thanks for the help!

If you're on macOS, that's what you should always do unless you have intermediate skills in compilation debugging. Even then, it often requires advanced skills.

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.