名前付きの列を含むインシデント マトリックスで、1 つのみの列を削除したいと考えています。
たとえば、
a b c
1 0 1 1
1 1 0 1
列 c を削除する必要があります。私は次のように考えます:
colnames(featureMatrix)[]
# get column names of 1-cols
useless <- colnames(matrix)[?]
# remove columns
matrix <- matrix[,!colnames(matrix) %in% useless ]
欠けているのは、列の合計に基づく条件です。