Читать книгу The Big R-Book - Philippe J. S. De Brouwer - Страница 59
Warning – Vector recycling
ОглавлениеThis behaviour is most probably different from what the experienced programmer will expect. Not only we can add or multiply vectors of different nature (e.g. long and real), but also we can do arithmetic on vectors of different size. This is usually not what you have in mind, and does lead to programming mistakes. Do take an effort to avoid vector recycling by explicitly building vectors of the right size.