【发布时间】:2014-02-01 04:38:58
【问题描述】:
我正在执行以下操作以导入一些 txt 表并将它们保留为列表:
# set working directory - the folder where all selection tables are stored
hypo_selections<-list.files() # change object name according to each species
hypo_list<-lapply(hypo_selections,read.table,sep="\t",header=T) # change object name according to each species
我想访问一个特定的元素,比如说hypo_list[1]。由于每个元素都代表一个表格,我应该如何访问特定的单元格(行和列)?
我想做类似的事情:
a<-hypo_list[1]
a[1,2]
但我收到以下错误消息:
Error in a[1, 2] : incorrect number of dimensions
有什么聪明的办法吗?
提前致谢!
【问题讨论】:
标签: r list indexing lapply read.table