我一直在尝试复制这个矩阵(R )Julia
data = read.csv("https://gist.githubusercontent.com/TJhon/158daa0c2dd06010d01a72dae2af8314/raw/61df065c98ec90b9ea3b8598d1996fb5371a64aa/rnd.csv")\n\nhead(model.matrix(y ~ (x1 + x2 + x3 + x4 + x5)^2, data), 3)\n#> (Intercept) x1 x2 x3 x4 x5 x1:x2\n#> 1 1 -0.3007225 -1.3710894 0.3423409 1.322547 2 0.41231744\n#> 2 1 0.4674170 0.8728939 0.9534157 -1.007083 1 0.40800548\n#> 3 1 0.2085316 -0.3657995 -0.3043694 -1.036938 4 -0.07628076\n#> x1:x3 x1:x4 x1:x5 x2:x3 x2:x4 x2:x5 x3:x4\n#> 1 -0.10294961 -0.3977198 -0.6014450 -0.4693799 -1.8133307 -2.7421787 0.4527620\n#> 2 0.44564276 -0.4707279 0.4674170 0.8322308 -0.8790769 0.8728939 -0.9601690\n#> 3 -0.06347064 -0.2162343 0.8341265 0.1113382 0.3793113 …Run Code Online (Sandbox Code Playgroud)