Strange problem with R, giving me unused argument error

Reproducible code

testing <- c(1, 2, 3, 4, 5, 8, 10, 20, 30)
mean(testing)

If I do this in R Studio v2023.12.1
and in R v4.3.2

I get this error message

"Error in mean(testing) : unused argument (testing)"

I had a bunch of code that was working and now I'm getting these strange errors

restart your R session without reloading your previous workspace

I deleted the .Rhistory and .Rdata files and installed up to R v4.3.3 and my once working code is once again working

Ctrl Shift and F10 will restart R on windows (also via the session menu) ; and not auto loading your workspace is controlled by options in R studio (Tools > Global Options)

Glad it worked for you, didnt expect you to reinstall R.

Probably the safest thing is to never save the work environment automatically. In RStudio, under Tools -> Global Options uncheck "Restore .RData into workspace at startup"

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.