rbind a rakelist

rbind_rakelist(rakelist, doc_id = NULL)

Arguments

rakelist

An object of class rakelist, which you create by calling slowrake.

doc_id

An optional vector of document IDs, which should be the same length as rakelist. These IDs will be added to the resulting data frame.

Value

A single data frame which contains all documents' keywords. The doc_id column tells you which document a keyword was found in.

Examples

rakelist <- slowrake(txt = dog_pubs$abstract[1:2])
#> 
  |                                                                            
  |                                                                      |   0%
  |                                                                            
  |===================================                                   |  50%
  |                                                                            
  |======================================================================| 100%

# Without specifying doc_id:
head(rbind_rakelist(rakelist))
#>   doc_id                            keyword freq     score
#> 1      1 assistance dog identification tags    1 10.833333
#> 2      1          animal control facilities    1  9.000000
#> 3      1          emotional support animals    1  9.000000
#> 4      1                   small body sizes    1  9.000000
#> 5      1       seemingly inappropriate dogs    1  7.916667
#> 6      1      governmental oversight system    1  7.333333
#>                          stem
#> 1      assist dog identif tag
#> 2          anim control facil
#> 3           emot support anim
#> 4             small bodi size
#> 5    seemingli inappropri dog
#> 6 government oversight system

# With specifying doc_id:
head(rbind_rakelist(rakelist, doc_id = dog_pubs$doi[1:2]))
#>                         doc_id                            keyword freq
#> 1 10.1371/journal.pone.0132820 assistance dog identification tags    1
#> 2 10.1371/journal.pone.0132820          animal control facilities    1
#> 3 10.1371/journal.pone.0132820          emotional support animals    1
#> 4 10.1371/journal.pone.0132820                   small body sizes    1
#> 5 10.1371/journal.pone.0132820       seemingly inappropriate dogs    1
#> 6 10.1371/journal.pone.0132820      governmental oversight system    1
#>       score                        stem
#> 1 10.833333      assist dog identif tag
#> 2  9.000000          anim control facil
#> 3  9.000000           emot support anim
#> 4  9.000000             small bodi size
#> 5  7.916667    seemingli inappropri dog
#> 6  7.333333 government oversight system