R 动态迭代问题
我使用一个tibble:20x1从我的df中提取迭代。 当我使用tibble数据作为过滤器时,问题就出现了R 动态迭代问题,r,iteration,tibble,linux-df,R,Iteration,Tibble,Linux Df,我使用一个tibble:20x1从我的df中提取迭代。 当我使用tibble数据作为过滤器时,问题就出现了 # Selecting unique list of 20 numeric variables from my data Lotes <- unique(dados[,1]) # Find its length as Integer for iteration LotesMatrix <- length(as.matrix(Lotes)) ##20L
# Selecting unique list of 20 numeric variables from my data
Lotes <- unique(dados[,1])
# Find its length as Integer for iteration
LotesMatrix <- length(as.matrix(Lotes)) ##20L
# iteration with my df named 'dados'
for (i in 1:LotesMatrix) {
Lote <- Lotes[i,1]
dados1 <- dados[dados$Lote == Lote,]
print(header(dados1))
}
#从我的数据中选择20个数字变量的唯一列表
Lotes答案是将搜索到的动态变量设置为字符串。i、 e
Lote <- as.integer(Lotes[i,1])
Lote看一看-在这里获得帮助的最佳方式是发布示例数据和预期输出,以及对问题的解释。如果没有具体的例子,你给出的描述有点难以理解。如果可能的话,发布一个。
Lote <- as.integer(Lotes[i,1])