How can subset assignment be useful?
I have been reading the R Language Definition file.
Recently I came across subset assignment as a shortcut for writing expressions.  For example


    > x <- c(1:16)
    > x[3:5] <- 13:15
    > x
    [1]  1  2 13 14 15  6  7  8  9 10 11 12 13 14 15 16

instead of

    > x <- c(1:16)
    > x[3:5] <- x[13:15]
    > x

This can be made much more elaborate as in

    > x[3:5] <- 13:15 + 15
    > x
    [1]  1  2 28 29 30  6  7  8  9 10 11 12 13 14 15 16
    > x[3:5] <- 13:15*15:15
    > x
    [1]   1   2 195 210 225   6   7   8   9  10  11  12  13  14  15  16

To me this seems like a neat trick.  On the other hand it seems like using it will inevitably lead to unreadable code.

Does anyone know of a good reason to use this kind of feature?
How can subset assignment be useful?
===

I have been reading the R Language Definition file.
Recently I came across subset assignment as a shortcut for writing expressions.  For example


    > x <- c(1:16)
    > x[3:5] <- 13:15
    > x
    [1]  1  2 13 14 15  6  7  8  9 10 11 12 13 14 15 16

instead of

    > x <- c(1:16)
    > x[3:5] <- x[13:15]
    > x

This can be made much more elaborate as in

    > x[3:5] <- 13:15 + 15
    > x
    [1]  1  2 28 29 30  6  7  8  9 10 11 12 13 14 15 16
    > x[3:5] <- 13:15*15:15
    > x
    [1]   1   2 195 210 225   6   7   8   9  10  11  12  13  14  15  16

To me this seems like a neat trick.  On the other hand it seems like using it will inevitably lead to unreadable code.

Does anyone know of a good reason to use this kind of feature?