[R-sig-Geo] [FORGED] Modifying the length of a matrix variable

Rolf Turner r@turner @end|ng |rom @uck|@nd@@c@nz
Sat Mar 30 22:12:21 CET 2019


On 31/03/19 3:56 AM, rain1290--- via R-sig-Geo wrote:

> Hello there, I am currently trying to modify a variable's length. It
> is called "Model4" and is a matrix. It currently has the length of
> 95, as per "length(Model4)". However, I would like to create a new
> Model4 (let's say "NewModel4"), in which it has a length of 90,
> instead of 95. Is there a way to do this? Thanks, and any assistance
> would be greatly appreciated! [[alternative HTML version deleted]]

This is a plain text mailing list.  Please *DO NOT* post in HTML.
(In general this scrambles your post and makes it incomprehensible.)

To get to your question:  What you ask makes little sense.  The "length" 
of a matrix is the total number of entries --- nrow(<matrix>) * 
ncol(<matrix>).  Changing the "length" of a matrix would either involve 
changing the number of rows or the number of columns (or both).

Why do you want to do this?  What are you trying to accomplish?
What does dim(Model4) produce?

Don't you think it's time you got serious and learned a bit about R?
(There are many excellent introductory documents available online.)

cheers,

Rolf Turner

-- 
Honorary Research Fellow
Department of Statistics
University of Auckland
Phone: +64-9-373-7599 ext. 88276



More information about the R-sig-Geo mailing list