Incompatibility between ggplot2 and other packages in R?

I am revising the document for submission and would like to replace the old grid graphics with the brilliant new versions of ggplot2. However, I encounter compatibility issues between ggplot2 and two packages that are absolutely important for my analyzes, coins and hands. When executing the following example from the manual

qplot(sleep_rem / sleep_total, awake, data = msleep)

I get an error message:

   Error in function (classes, fdef, mtable)  : 
   unable to find an inherited method for function "empty", for signature "data.frame"

as soon as one coin or sleeve is loaded.

Here are the details:

Starting R 2.10.1, empty .RData file p>

require(ggplot2)
require(xtable)
require(MASS)
require(gdata)
require(car)
require(Hmisc)
require(psych)

qplot(sleep_rem / sleep_total, awake, data = msleep)

require(coin)
qplot(sleep_rem / sleep_total, awake, data = msleep)

require(arm)
qplot(sleep_rem / sleep_total, awake, data = msleep)

Is it reproducible with R 2.12? If not, maybe it's worth upgrading? I must admit, I do not want to update the working system, especially in a short time.

+3
source share
1 answer

, . , , coin (modeltools, ), empty(), empty() plyr. R 2.12 , . ggplot plyr::empty() . plyr, .

:

require(coin)
empty <- plyr::empty
qplot(sleep_rem / sleep_total, awake, data = msleep)
rm(empty)

2.11.1 :

msleep <- data.frame(
    sleep_rem=c(1,2,3,4,5),
    sleep_total=c(10,20,30,40,50),
    awake=c(5,4,3,2,1)
)

, empty . . , coin.

+7

Source: https://habr.com/ru/post/1769975/


All Articles