列表中每个数据框的行数 [英] number of rows each data frame in a list
本文介绍了列表中每个数据框的行数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我在R中有一个数据帧列表.它们是使用lapply和read.csv命令创建的.我想知道列表中每个数据框的行数. nrow命令不适用于此列表.我不确定可能是因为它是一个列表.关于计数列表中每个数据帧的行数有任何想法吗?
I have a list of data frames in R. They are created using lapply and read.csv commands. I want to know the number of rows of each data frame in the list. The nrow command does not work for this list. I am not sure may because it is a list. Any idea about counting the number of rows of each data frame in a list?
推荐答案
列表没有行.使用sapply
遍历列表:
Lists don't have rows. Use sapply
to loop over the list:
sapply(data.frame.list, nrow)
这篇关于列表中每个数据框的行数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文