Data table error could not find function “.”

后端 未结 2 807
醉酒成梦
醉酒成梦 2020-12-07 02:16

I am trying to run the following piece of code. Whenever I try to run the code I get the following error: Error in eval(expr, envir, enclos) : could not find function

相关标签:
2条回答
  • 2020-12-07 02:45

    See this SO question.

    Make mtcarsDT as data.table object by doing

    mtcarsDT <- setDT(mtcars) and proceed from there.

    Hope it works!

    0 讨论(0)
  • 2020-12-07 02:49

    Apparently the instructions I offered 2.5 years ago are still current for people using out-of-date versions of Mac R. Assuming you have Xcode and the Command Line Tools installed, you need to first either a) restart R (without loading any of the versions of data.table., reshape2, and dplyr), or b) remove any loaded Namespaces that might conflict with the ability to test-load the new packages:

    unloadNamespace('data.table')
    unloadNamespace('reshape2')
    unloadNamespace('plyr')
    

    Then build from source:

    install.packages("data.table", type="source", dependencies=TRUE)
    

    The reason that building from source might work when installing a binary package might not is that the former strategy gets you better checking for version dependencies.

    0 讨论(0)
提交回复
热议问题