0

I ran the following code in RStudio:

library("lsr")
df <- data.frame(               
  rt = c(451, 562, 704, 324, 505, 600, 829), 
  cond = factor(x=c(1, 1, 1, 2, 2, 2, 2), labels=c("group1", "group2")))

# Welch t-test
independentSamplesTTest(rt ~ cond, df)

and received the following error:

Error in get(as.character(FUN), mode = "function", envir = envir) :
object 'FUN' of mode 'function' was not found

I read on another page that if I run rm(mean) this would be resolved, but, it doesn't help either.

MLavoie
  • 9,671
  • 41
  • 36
  • 56
  • 1
    I was able to run your code without any issue. So the code seems to be OK. How are you trying to run it. (And it has nothing to do with `rm(mean)`.) – oszkar Apr 15 '20 at 21:51
  • Just restart your R studio, In case of conflicts it can happen. so restarting R studio can sometimes fix the problem, make sure your session after restarting Rstudio is clean and should automatically restore the earlier sessions. – PKumar Apr 16 '20 at 07:04
  • Thanks for the response. I restarted R and I still get the same error message. – Hoda Barzegaran Apr 16 '20 at 14:48
  • Check the first answer here: https://stackoverflow.com/questions/21367922/error-in-getas-characterfun-mode-function-envir-envir – oszkar Apr 16 '20 at 15:11
  • @HodaBarzegaran have you saved your workspace before restarting? – oszkar Apr 16 '20 at 15:14

0 Answers0