I recently changed to Mac OS X 10.7.3 from Windows and this simple function is giving errors.> c(4,7,7)Error in c(4, 7, 7) : unused argument(s) (7)> c(1,7:9)Error in d[i, ] : incorrect number of dimensions> c(1:5, 10.5, "next")Error in c(1:5, 10.5, "next") : unused argument(s) ("next")> c(1,2)Error in d[i, ] : incorrect number of dimensions I removed R and reinstalled, but I get the same problem. Could you please help? Thank you. [[alternative HTML version deleted]]
Hi, My best guess is that the c() you want to be calling is not the c() you are calling. This can happen if it is masked by a function definition in you global environment or in a package you load. What happens when you type: c at the console? Also, from one of your sessions where it , c(), does not behave as you expect, can you report the output of: sessionInfo() as the posting guide requests? Cheers, Josh On Sat, May 5, 2012 at 2:17 PM, E Kim <emkim1000 at gmail.com> wrote:> I recently changed to Mac OS X 10.7.3 from Windows and this simple function > is giving errors. > >> c(4,7,7) > Error in c(4, 7, 7) : unused argument(s) (7) > >> c(1,7:9) > > Error in d[i, ] : incorrect number of dimensions > > >> c(1:5, 10.5, "next") > Error in c(1:5, 10.5, "next") : unused argument(s) ("next") > >> c(1,2) > > Error in d[i, ] : incorrect number of dimensions > > > > I removed R and reinstalled, but I get the same problem. > > Could you please help? > > > Thank you. > > ? ? ? ?[[alternative HTML version deleted]] > > ______________________________________________ > R-help at r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code.-- Joshua Wiley Ph.D. Student, Health Psychology Programmer Analyst II, Statistical Consulting Group University of California, Los Angeles https://joshuawiley.com/
My guess is that somewhere you've accidentally redefined "c" to be another function. Try this: Open the Terminal and type R --vanilla this will start R totally clean and then try c(4,7,7) c(1, 7:9) I bet your issues go away. If that's the case, you can probably fix things by clearing your old R session (which is probably being auto-loaded each time) or by simply trying rm(c) to delete whatever you called c which overrode (is that the right spelling?) the "real" c() Hope this helps, Michael On Sat, May 5, 2012 at 5:17 PM, E Kim <emkim1000 at gmail.com> wrote:> I recently changed to Mac OS X 10.7.3 from Windows and this simple function > is giving errors. > >> c(4,7,7) > Error in c(4, 7, 7) : unused argument(s) (7) > >> c(1,7:9) > > Error in d[i, ] : incorrect number of dimensions > > >> c(1:5, 10.5, "next") > Error in c(1:5, 10.5, "next") : unused argument(s) ("next") > >> c(1,2) > > Error in d[i, ] : incorrect number of dimensions > > > > I removed R and reinstalled, but I get the same problem. > > Could you please help? > > > Thank you. > > ? ? ? ?[[alternative HTML version deleted]] > > ______________________________________________ > R-help at r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code.
almost certainly you restored an old workspace with a conflicting definition of the c function. type c to confirm, also type conflicts(detail=TRUE) The repair is to remove the conflicting definition rm(c) The long term solution is to adopt the recommended practice of not saving your workspace at the end of an R session. When R asks about saving when you type q(), say no. You can get rid of the .RData you have by finding out what directory it is in with getwd() and then closing R and removing the .RData from outside R. On Sat, May 5, 2012 at 5:17 PM, E Kim <emkim1000@gmail.com> wrote:> I recently changed to Mac OS X 10.7.3 from Windows and this simple function > is giving errors. > > > c(4,7,7) > Error in c(4, 7, 7) : unused argument(s) (7) > > > c(1,7:9) > > Error in d[i, ] : incorrect number of dimensions > > > > c(1:5, 10.5, "next") > Error in c(1:5, 10.5, "next") : unused argument(s) ("next") > > > c(1,2) > > Error in d[i, ] : incorrect number of dimensions > > > > I removed R and reinstalled, but I get the same problem. > > Could you please help? > > > Thank you. > > [[alternative HTML version deleted]] > > ______________________________________________ > R-help@r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide > http://www.R-project.org/posting-guide.html<http://www.r-project.org/posting-guide.html> > and provide commented, minimal, self-contained, reproducible code. >[[alternative HTML version deleted]]