我正在尝试使用标记的数字数据矩阵构建 PCA。我正在尝试仅选择某些列 (6-78) 以包含在 PCA 中,但出现错误(语法?)
这是代码:
cytokines.pca <- prcomp(PICHCytokines[,c(6:78)], center = TRUE, scale. = TRUE)
summary(cytokines.pca)
错误是:
[.data.frame
(data, , c(6:78))中的错误:选择了未定义的列
这是我的数据框的结构:
str(PICHCytokines)
'data.frame': 106 obs. of 69 variables:
$ Record.ID : Factor w/ 106 levels "FA001","FA007",..: 1 2 3 4 5 6 7 8 9 10 ...
..- attr(*, "label")= chr "Record ID"
$ Event.Name : Factor w/ 2 levels "Enrollment and Admission",..: 1 1 1 1 1 1 1 1 1 1 ...
..- attr(*, "label")= chr "Event Name"
$ Time.since.trauma: 'labelled' num 0.717 7.717 1.383 0.817 2.85 ...
..- attr(*, "label")= chr "Time since trauma"
$ Batch.Number : 'labelled' int 1 1 1 1 1 1 1 1 1 1 ...
..- attr(*, "label")= chr "Batch Number"
$ Plate.Number : 'labelled' int 1 1 1 1 1 1 1 1 1 1 ...
..- attr(*, "label")= chr "Plate Number"
$ FASL.MFI : 'labelled' num 748 295 256 333 275 ...
..- attr(*, "label")= chr "FASL MFI"
$ TGFA.MFI : 'labelled' num 122 64.2 96 126 94.8 ...
..- attr(*, "label")= chr "TGFA MFI"
$ MIP1A.MFI : 'labelled' num 1611 142 158 339 168 ...
..- attr(*, "label")= chr "MIP1A MFI"
$ IL27.MFI : 'labelled' num 139.2 40 63 52.5 63.2 ...
..- attr(*, "label")= chr "IL27 MFI"
$ IL1B.MFI : 'labelled' num 68 38.2 77.5 46 70.8 ...
..- attr(*, "label")= chr "IL1B MFI"
$ IL2.MFI : 'labelled' num 159 61.5 120.8 79.5 117.2 ...
..- attr(*, "label")= chr "IL2 MFI"