我有一个称为powershell -command "Get-Clipboard | sort | Set-Clipboard"
的下面的矩阵:
al_freq
它看起来是这样的:
structure(c(0.3204, 0.3266, 0.3645, 0.1615, 0.2884,
0.3042, 0.4437, 0.3896,0.4264, 0.2308, 0.2997,
0.3148, 0.1408, 0.1036, 0.076, 0.0923, 0.0604,
0.0776, 0.1373, 0.0878, 0.0686, 0.0957, 0.0579,
0.0767, 0.3134, 0.3176, 0.3612, 0.1248, 0.2237,
0.0847, 0.1408, 0.1014, 0.0686, 0.0906, 0.0596, 0.075),
.Dim = c(6L, 6L), .Dimnames = list(c("ES1-5", "ES6-13",
"ES14-26", "ES27-38", "SA1-13", "SA14-25"),
c("1A-1145442", "1A-1158042", "1A-1158055",
"1A-1229616", "1A-1236254", "1A-1238114")))
当我使用 1A-1145442 1A-1158042 1A-1158055 1A-1229616 1A-1236254 1A-1238114
ES1-5 0.3204 0.4437 0.1408 0.1373 0.3134 0.1408
ES6-13 0.3266 0.3896 0.1036 0.0878 0.3176 0.1014
ES14-26 0.3645 0.4264 0.0760 0.0686 0.3612 0.0686
ES27-38 0.1615 0.2308 0.0923 0.0957 0.1248 0.0906
SA1-13 0.2884 0.2997 0.0604 0.0579 0.2237 0.0596
SA14-25 0.3042 0.3148 0.0776 0.0767 0.0847 0.0750
函数时:apply
我收到此错误:
x中的错误-表示:二进制运算符的非数字参数
我不明白为什么会这样,因为apply循环遍历矩阵的每个显然是数字的元素。我在哪里错了?