Meaning of %o% in R
问题 I encountered the following in R: x=x+y%o%c(1.5,1.5) I am wondering what is the meaning of %o% here. I tried googling but didn't have much luck 回答1: There are a number of shortcuts in R that use the %...% notation. %o% is the outer product of arrays > 1:3 %o% 1:3 [,1] [,2] [,3] [1,] 1 2 3 [2,] 2 4 6 [3,] 3 6 9 There are a number of others, my most used is %in% : 3 %in% c(1,2,3,4) #TRUE 5 %in% c(1,2,3,4) #FALSE 3.4 %in% c(1,2,3,4) #FALSE There are a few others, I don't know them all off the