I keep getting an 'unused arguments' error when I call the SMD function
I'm using smd() as part of a larger data analysis, comparing groups created through k-means clustering. And it was all working fine... until it wasn't. I'd been editing other parts of the main script - adding a derived variable.
I've puzzled for some time, checking syntax and the code that creates the function arguments. All to no avail. Finally I wrote a short script to see if I had this problem with some very basic data. And I still do. The new script is
library(smd)
Mean_x <- 75
Mean_y <- 25
n_x <- 25
n_y <- 25
sd_x <- 40
sd_y <- 20
temp_smd <- smd(Mean.1=Mean_x, Mean.2=Mean_y, s.1=sd_x, s.2=sd_y, n.1=n_x, n.2=n_y)
... and I get the error message
Error in smd(Mean.1 = Mean_x, Mean.2 = Mean_y, s.1 = sd_x, s.2 = sd_y, :
unused arguments (Mean.1 = Mean_x, Mean.2 = Mean_y, s.1 = sd_x, s.2 = sd_y, n.1 = n_x, n.2 = n_y)
I even tried smd::smd, in case there was a package conflict that I wasn't aware of.
All help appreciated
You're using two different packages (
{MBESS}
and{smd}
) with two differentsmd()
functions.In your code above, you use
library(smd)
which does not take these arguments in thesmd()
function. And so of course, tryingsmd::smd
gives the same error. After reinstalling{MBESS}
(and I'm guessing probably changing the order of library loading),MBESS::smd
has taken precedence oversmd::smd
again, so now it's working again.