user2206985
user2206985

Reputation: 313

Create automatically a table from a data output in R

I have some trouble in R and hope to find some help here.

I have a data output from a loop of the following form, whereas the number of countries can vary:

> data
$Australia
   HITTypeId    HITId    Valid
1   123          555     TRUE

$India
   HITTypeId    HITId    Valid
 1  456          888     TRUE

Now what I am looking for, is to create a data table that gives my automatically something of the following form:

  country       HITTypeId      HITId    Valid
1  Austria         123          555     TRUE
2  Belgium         456          888     TRUE

I would appreciate any help!

Upvotes: 1

Views: 327

Answers (1)

Ferdinand.kraft
Ferdinand.kraft

Reputation: 12819

Use this function:

do.call(rbind, data)

Upvotes: 2

Related Questions