On 04/11/2007 1:28 AM, Edna Bell wrote:
> Hi R Gurus!
> 
> When creating a matrix, is it better to use the structure function or
> the matrix function, please?

I'd use the matrix() function.  You can do it with structure(), and your 
code might be a little faster, but it will be harder to read, will break 
if someone ever changes the low-level implementation of matrices, e.g. 
by replacing it with the Matrix class.

Duncan Murdoch

______________________________________________
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.

Reply via email to