开发者

S4 class in R for matrix

开发者 https://www.devze.com 2023-02-14 18:46 出处:网络
This is a follow-up question to a previous post. I need to write an initialize() method for a S4 class (named Band) that expects a matrix and a value for k. It should be defined as a function with fo

This is a follow-up question to a previous post.

I need to write an initialize() method for a S4 class (named Band) that expects a matrix and a value for k. It should be defined as a function with formal argume开发者_开发知识库nts (x, k), and should put the lower triangular elements of X into the object.

Any suggestions appreciated.


The Matrix package has many examples of matrix-related S4 classes and methods:

http://cran.r-project.org/web/packages/Matrix/

Download the source and check it out.

0

精彩评论

暂无评论...
验证码 换一张
取 消