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 <[email protected]> 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 <[email protected]> To: [email protected] Date:
> 08/01/2011
> 11:56 AM Subject: [R] 5 arguments passed to .Internal(matrix) which
> requires 7 Sent by: [email protected]
> ------------------------------
>
>
>
> 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]]
>
> ______________________________________________
> [email protected] 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]]
______________________________________________
[email protected] 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.