-
Notifications
You must be signed in to change notification settings - Fork 4
Open
Description
In the R user meeting of Nov 16th, we had a question why
(1:5) %*% t(2:6)
[,1] [,2] [,3] [,4] [,5]
[1,] 2 3 4 5 6
[2,] 4 6 8 10 12
[3,] 6 9 12 15 18
[4,] 8 12 16 20 24
[5,] 10 15 20 25 30but
(1:5) %/% t(2:6)
[,1] [,2] [,3] [,4] [,5]
[1,] 0 0 0 0 0??
I don't know, but the solution (given by another participant) is:
outer((1:5),(2:6),"/")
[,1] [,2] [,3] [,4] [,5]
[1,] 0.5 0.3333333 0.25 0.2 0.1666667
[2,] 1.0 0.6666667 0.50 0.4 0.3333333
[3,] 1.5 1.0000000 0.75 0.6 0.5000000
[4,] 2.0 1.3333333 1.00 0.8 0.6666667
[5,] 2.5 1.6666667 1.25 1.0 0.8333333Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels