That's interesting. My function matrix() looks like this: function (data = NA, nrow = 1, ncol = 1, byrow = FALSE, dimnames = NULL) { if (is.object(data) || !is.atomic(data)) data <- as.vector(data) .Internal(matrix(data, nrow, ncol, byrow, dimnames, missing(nrow), missing(ncol))) } <environment: namespace:base>
I'm running Windows R version 2.13.0 (2011-04-13). Jean From: Robert Pfister <rw...@virginia.edu> To: Jean V Adams <jvad...@usgs.gov> Cc: r-help@r-project.org Date: 08/01/2011 01:35 PM Subject: Re: [R] 5 arguments passed to .Internal(matrix) which requires 7 Yes, even if I only run the command matrix(0,30,10) I get the error. I am running R with Ubuntu 10.10 (maverick) with R version: R version 2.13.1 (2011-07-08) When I check the function matrix, I can see that it is only passing five arguments to the function .Internal() (shown below). function (data = NA, nrow = 1, ncol = 1, byrow = FALSE, dimnames = NULL) { data <- as.vector(data) if (missing(nrow)) nrow <- ceiling(length(data)/ncol) else if (missing(ncol)) ncol <- ceiling(length(data)/nrow) .Internal(matrix(data, nrow, ncol, byrow, dimnames)) } <environment: namespace:base> On Mon, Aug 1, 2011 at 1:02 PM, Jean V Adams <jvad...@usgs.gov> wrote: Robert, What code did you run to get that error? Do you get the error if the only code that you run is ... matrix(0, 30, 10) You gave three arguments to matrix, which requires none, but can take up to five. In the function matrix there is a call to .Internal(matrix) which requires 7 arguments. See ... matrix Jean `·.,, ><(((º> `·.,, ><(((º> `·.,, ><(((º> Jean V. Adams Statistician U.S. Geological Survey Great Lakes Science Center 223 East Steinfest Road Antigo, WI 54409 USA From: Robert Pfister <rw...@virginia.edu> To: r-help@r-project.org Date: 08/01/2011 11:56 AM Subject: [R] 5 arguments passed to .Internal(matrix) which requires 7 Sent by: r-help-boun...@r-project.org Hello, I am having a problem with the function matrix. Specifically, when I pass three arguments (two more being instantiated in the function), I get the following error message: Error in matrix(0, 30, 10) : 5 arguments passed to .Internal(matrix) which requires 7 I looked into it, and someone has suggested that this may be the function from an old version of R. I recently changed my source path from the lucid version to the maverick version and installed all of the R packages I need like so, but why would this change the matrix() function? Also, how does R know that I passed five arguments (only three being given) if the matrix() function is supposed to take seven arguments? Thank you, Robert [[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 and provide commented, minimal, self-contained, reproducible code. [[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 and provide commented, minimal, self-contained, reproducible code.