Problem with the "sum" in Rstudio

Asked

Viewed 56 times

1

I have a problem with the function sum in Rstudio that returns the error attached. I know it is an error that should not occur because it is not from the code. I have already reinstalled Rstudio and continue to make the same mistake. This error does not occur in the R or Rstudio of another laptop. What do you advise me to do? Is there a package that fixes this?

x <- sample( 6, 1000, replace = T) sum ( x == 3)

Error

Error in sum(x == 3) : argument "x" is missing, with no default

  • 2

    from what I read elsewhere, this may be because you have two functions with the name sum, if you give an rm(sum) and then try, what happens?

  • Dear Lucas Miranda. Thank you for your comment. It was solved. I still have little experience and did not imagine that was the problem.

  • Good morning, Aunus, I’m glad you decided! answer the question itself then and mark as right for the future if someone has this doubt know what to do!

1 answer

1


The issue was resolved with the support of Lucas Miranda and the solution was to clear the memory of Rstudio through the command rm(sum)because there was a function called sumthat was creating conflict with the summation operation

Browser other questions tagged

You are not signed in. Login or sign up in order to post.