If what @chris.prener suggests doesn't fix this ...
Are you on Windows? If so, install.packages() can get into a sad state where it gets part way through a (re-)install, but fails, leaving a corrupt version of the package behind. You can't use it, but you can't update it and you seem to be stuck. And you can't install anything that depends on this problem package.
Let's say the problem package is named "foo". In R, note the location of the installed package: system.file(package = "foo") will reveal the folder containing the installed foo package.
Now quit all instances of R and RStudio. Delete the foo package manually, using whatever method you normally use to delete a folder. Then relaunch R, probably within RStudio. Use install.packages() to get a fresh install of foo. If you encountered this problem on the way to installing some other package, it is possible you may need to go through a sequence of such fixes, for various dependencies, to get everything sorted out.
Another explanation of what I am describing: