私は同じ列を持ち、各データフレームの行数が異なるデータフレームのリストを持っています。すべての行を1つのデータフレームに連結するにはどうすればよいですか?長さの異なるデータフレームのリストを連結するにはどうすればよいですか?
require('jsonlite')
# Get the list of repos for each of these GitHub user
users <- c('hadley', 'schmidt4brains', 'fred')
urls <- lapply(users, function(user) paste0("https://api.github.com/users/", user, "/repos"))
# Fetch all the repos from all users.
# Now we have a list of 3 data frames: same columns, but different row counts
repo_list <- lapply(urls, fromJSON)
すべてのデータフレームのすべての行を1つのデータフレームに結合するにはどうすればよいですか?
sapply(repo_list, identity)
はすべての行を結合しますが、結果はデータフレームではなく、すべての列名が失われています。
あなたは 'rbind()'やsuccintly 'do.call(rbind、repo_list)'を望みます。 – Jthorpe