0
我有一個很大的數據框。如果第一行中的值不低於某個閾值,我需要通過並測試第一行值並刪除列。應用函數刪除列R
red <- c(1,2,3)
blue <- c(4, 5, 4)
colors <- data.frame(red, blue)
colors <- t(colors)
colors
[,1] [,2] [,3]
red 1 2 3
blue 4 5 4
例如,我將如何只保留紅色值低於2.5的列?
非常感謝!我仍然很新!