我自己查了一些回答说报错原因是因为我提交的数据包含NA数量超过三个,但是实际上我没有空值。
这个代码在我有9个样本的时候是可以执行成功的,而样本数量只有8个的时候失败了。
下面是代码和报错。
tt.norm.PCA %>%
+ pivot_sample() %>%
+ select(starts_with("PC"), condition) %>%
+ GGally::ggpairs(columns =paste("PC", 1:8,sep = ""),ggplot2::aes(colour= condition))
plot: [1,2] [>----------------------------------------] 3% est: 2s Error in cor.test.default(x, y, method = method, use = use) :
not enough finite observations
8个样本时候数据如下
tt.norm.PCA %>%
+ pivot_sample() %>%
+ select(starts_with("PC"), condition)
# A tibble: 8 x 9
PC1 PC2 PC3 PC4 PC5 PC6 PC7 PC8
<dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl>
1 -27.1 12.8 -0.628 2.79 -8.62 6.74 22.2 1.03e-14
2 -26.0 7.71 -4.25 0.643 -14.1 12.4 -18.9 -3.90e-15
3 -27.3 14.1 7.81 9.63 13.0 -19.2 -5.22 4.40e-14
4 33.7 -2.99 12.2 -7.38 -20.5 -13.9 0.295 -4.08e-16
5 37.5 11.3 -28.7 1.14 5.66 -1.98 0.169 3.78e-15
6 34.6 -0.0910 19.1 11.8 10.9 15.1 -0.558 -1.80e-14
7 -14.8 -37.0 -8.43 10.3 0.324 -2.47 1.71 2.43e-14
8 -10.6 -5.90 2.97 -28.9 13.2 3.30 0.293 -1.13e-14
# ... with 1 more variable: condition <chr>