Unable to load library of dplyr and ggplot2

For several weeks now I have been unable to load several packages in R. To remedy this, I reinstalled R 4.0.3 and RStudio 1.4.1103 but failed to load several packages, including dplyr and ggplot2. I have searched the internet and tried to resolve the issue for days now but in vain. Please help. Just so you know, I get the following error:
Error: package or namespace load failed for ‘dplyr’:
.onLoad failed in loadNamespace() for 'pillar', details:
call: loadNamespace(name)
error: there is no package called ‘crayon’
Error: package or namespace load failed for ‘ggplot2’:
.onLoad failed in loadNamespace() for 'pillar', details:
call: loadNamespace(name)
error: there is no package called ‘crayon’

You are missing this package dependency, try installing it

install.packages("crayon")

Thanks for your quick reply! I guess I should have made this clear in my post: whenever I install a dependency and try loading these two packages again, I get another error message, which says some other package is missing. And this process continues! What do you think is the problem?

You are not describing any problem, just how package installation in R works, you just have to keep installing package dependencies until you get no more error messages.

Thanks for your reply! I have never had this problem before. I reckoned all package dependencies would be installed automatically. Earlier, I gave up after installing a few dependencies, thinking the issue is deeper, but today after your advice, I persevered and thankfully, managed to get the packages to work. Thank you again!

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.