Hello,

I'm am in the process of trying to port a RATS functions to R and have
the problem, that RATS allows for the creation of submatrixes that are
linked to their basematrix.

Basically it should work like this:

a = matrix(1:(4*3),4,3)
a
#      [,1] [,2] [,3]
# [1,]    1    5    9
# [2,]    2    6   10
# [3,]    3    7   11
# [4,]    4    8   12

# This of course doesnt work :)
b = submatrix(a,fromx=1,tox=2,fromy=1,toy=2)
b
#      [,1] [,2]
# [1,]    0   10
# [2,]    7   11
b[1,1] = 42
a[1,1]
# [1] 42

so changes in the sub-matrix propagate to the "base" matrix.

Does such a feature exist?

Thanks,

______________________________________________
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