R: simple multiplication causes integer overflow
In a longer script I have to multiply the length of a vector A (2614) with the numbers of rows of a dataframe B (1456000). If I do that directly with length(A) * nrow(B) I get the message NAs produced by integer overflow although there's no problem when I multiply the same numbers: 2614 * 1456000 [1] 3805984000 The only way to get the multiplication to work is round(length(A)) * nrow(B) or length(A) * round(nrow(B)) . But the numbers produced by length and nrow must be integers anyhow! Moreover, I tested this with the following function suggested on the help page for the function is.integer...