[External] Function of "matrix"
FAQ 7.31
10.1/.1
[1] 101
print(10.1/.1, digits=17)
[1] 100.99999999999999
floor(10.1/.1)
[1] 100
floor(10.1*10)
[1] 101
matrix(0, 2.9, 3.9)
[,1] [,2] [,3] [1,] 0 0 0 [2,] 0 0 0
note that the dimension arguments are passed through floor() before they are used.
On Thu, Oct 22, 2020 at 2:42 PM ?????? <jaajikan at gmail.com> wrote:
Dear R project team
I used the function of "matrix" as follows:
matrix(c(1:3030), 10.1/0.1)
However, in the function, matrix, 10.1/0.1 was regarded as 100 not as 101.
Therefore, a warning message appeared.
On the other hand, matrix(c(1:3030), 101) or matrix(c(1:3030), 10.1*10) was
OK. Of course, simply, 10.1/0.1 was successfully calculated. However,
In the "matrix" environment, 10.1/0.1 was calculated as 100.
Would you give me some answers?
Sincerely
Kazuki Sakura
[[alternative HTML version deleted]]
______________________________________________ R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see 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.