R dataframe 遗忘, which 矩阵搜索
2017-07-25 16:31 xplorerthik 阅读(567) 评论(0) 编辑 收藏 举报A data frame is used for storing data tables. It is a list of vectors of equal length. For example, the following variable df is a data frame containing three vectors n, s, b.
n = c(2, 3, 5)
s = c("aa", "bb", "cc")
a <- data.frame(x = c(1,2,3), y = c(4,5,6), z = c(7,8,9))
x <- as.matrix(a)
idx <- which(x > 5, arr.ind=TRUE)