adding tables to a list in R via loop <p>I am reading HTML tables, and can do that fine, but I am collecting tables from multiple years. Unfortunately, the columns and rows are different in each year, so I wanted to add them all recursively to a list, so I can later apply lapply and do some analysis.</p> <p>I can download the table and manipulate it into a dataframe when I do it once, but then when I add it to a list, the list only accepts the first column.</p> <pre><code>library(XML) #reg r=readHTMLTable('http://www.nhl.com/stats/team?season=20132014&amp;gameType=2&amp;viewName=summary#',stringsAsFactors=FALSE) r=as.data.frame(r[3]) for(i in 3:ncol(r)){ r[,i]=as.numeric(r[,i]) } </code></pre> <p>This gives me r as something I can manipulate. I want to add it to a list:</p> <pre><code>&gt; l=as.list(NULL) &gt; l[1]=r Warning message: In l[1] = r : number of items to replace is not a multiple of replacement length &gt; l [[1]] [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" "13" "14" "15" [16] "16" "17" "18" "19" "20" "21" "22" "23" "24" "25" "26" "27" "28" "29" "30" </code></pre> <p>Does anyone know how I can add it into my list so I keep the dimensions</p> <pre><code>&gt; dim(r) [1] 30 25 </code></pre> <p>The issue is, I have many other tables that I would like to add, and was able to add them, but each one that was added only included the first column/element.</p> <p>Any ideas is greatly appreciated</p> <p>Thanks!</p>