6

I'm getting that error message when running

library(gt) 

Help would be appreciated

Ronak Shah
  • 377,200
  • 20
  • 156
  • 213
Jorge Lopez
  • 467
  • 4
  • 10
  • Can you do a fresh install of `gt`. Also, please specify the `R` version you are using. Maybe update R if it is an old version and then install the packages – akrun Sep 05 '21 at 23:25

5 Answers5

12

install.packages("fastmap") solved my problem.

Henry Ecker
  • 34,399
  • 18
  • 41
  • 57
OliC
  • 133
  • 5
  • 1
    Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Oct 31 '21 at 11:01
6

You probably have an older version of fastmap. Run update.packages("fastmap").

EDITED to add: A comment said that update.packages didn't work, but a new install did. A possible cause for weird behaviour like this is that you have two R libraries installed: a user library and a system library. They can each have different versions of the same package. update.packages() sees the newer one, but the code triggering the error uses the older one. .libPaths() will show the currently visible libraries, e.g. on my Mac I currently see

> .libPaths()
[1] "/Library/Frameworks/R.framework/Versions/4.1/Resources/library"

This is the system library. If I install a package somewhere else I'll probably see that path listed as well, but not necessarily if I restart R in another session. This can lead to very confusing behaviour.

One way to get into such a mess is to install some packages while running with admin privileges, and others without. The admin-installed packages will probably go into the system library, while the user-installed packages will go into a user library.

user2554330
  • 37,248
  • 4
  • 43
  • 90
0

I just had to reinstall everything - R, and R Studio using the latest updates from CRAN. Then everything was fine.

Jorge Lopez
  • 467
  • 4
  • 10
0

Had the same problem - I solved it by updating all my packages.

0

You might get away with uninstalling fastmap, then reinstalling it. Rather than reinstalling everything.

Ken
  • 41
  • 1
  • 8
  • 1
    Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Feb 02 '22 at 02:44