Skip to content
Prev 377309 / 398502 Next

Problem with the matrix() function.

There are other functions where R handles a vector argument differently. The first value may be silently used, used with a warning, or trigger an error.
[1] 1 2 3 4 5 6 7 8 9
Warning message:
In x:9 : numerical expression has 3 elements: only the first used
Error in seq.default(x, 9) : 'from' must be of length 1
Error in rep(1, x) : invalid 'times' argument

----------------------------------------
David L Carlson
Department of Anthropology
Texas A&M University
College Station, TX 77843-4352

-----Original Message-----
From: R-help <r-help-bounces at r-project.org> On Behalf Of Bert Gunter
Sent: Wednesday, November 7, 2018 2:49 PM
To: Rolf Turner <r.turner at auckland.ac.nz>
Cc: R-help <r-help at r-project.org>
Subject: Re: [R] Problem with the matrix() function.

I have no opinion on your queries, but whatever is done, it should be
properly documented, which appears not to be the case presently afaics.

-- Bert
On Wed, Nov 7, 2018 at 12:33 PM Rolf Turner <r.turner at auckland.ac.nz> wrote:

            
______________________________________________
R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see
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.