Use partition_bundle to create a partition_bundle object, which combines a set of partition objects.

partition_bundle(.Object, ...)

# S4 method for partition
partition_bundle(
  .Object,
  s_attribute,
  values = NULL,
  prefix = "",
  mc = getOption("polmineR.mc"),
  verbose = TRUE,
  progress = FALSE,
  type = get_type(.Object),
  ...
)

# S4 method for corpus
partition_bundle(
  .Object,
  s_attribute,
  values = NULL,
  prefix = "",
  mc = getOption("polmineR.mc"),
  verbose = TRUE,
  progress = FALSE,
  xml = "flat",
  type = get_type(.Object),
  ...
)

# S4 method for character
partition_bundle(
  .Object,
  s_attribute,
  values = NULL,
  prefix = "",
  mc = getOption("polmineR.mc"),
  verbose = TRUE,
  progress = FALSE,
  xml = "flat",
  type = get_type(.Object),
  ...
)

# S4 method for context
partition_bundle(.Object, node = TRUE, progress = TRUE, mc = 1L)

# S4 method for partition_bundle
partition_bundle(
  .Object,
  s_attribute,
  prefix = character(),
  progress = TRUE,
  mc = getOption("polmineR.mc")
)

Arguments

.Object

A partition, a length-one character vector supplying a CWB corpus, or a partition_bundle

...

parameters to be passed into partition-method (see respective documentation)

s_attribute

The s-attribute to vary.

values

Values the s-attribute provided shall assume.

prefix

A character vector that will be attached as a prefix to partition names.

mc

Logical, whether to use multicore parallelization.

verbose

Logical, whether to provide progress information.

progress

Logical, whether to show progress bar.

type

The type of partition to generate.

xml

A logical value.

node

A logical value, whether to include the node (i.e. query matches) in the region matrix generated when creating a partition from a context-object.

Value

S4 class partition_bundle, with list of partition objects in slot 'objects'

Details

Applying the partition_bundle-method to a partition_bundle-object will iterate through the partition objects in the object-slot in the partition_bundle, and apply partition_bundle on each partition, splitting it up by the s-attribute provided by the argument s_attribute. The return value is a partition_bundle, the names of which will be the names of the incoming partition_bundle concatenated with the s-attribute values used for splitting. The argument prefix can be used to achieve a more descriptive name.

See also

Author

Andreas Blaette

Examples

use("polmineR")
#> ... activating corpus: GERMAPARLMINI (version: 0.0.1 | build date: 2019-02-23)
#> ... activating corpus: REUTERS
bt2009 <- partition("GERMAPARLMINI", date = "2009-.*", regex = TRUE)
#> ... get encoding: latin1
#> ... get cpos and strucs
pb <- partition_bundle(bt2009, s_attribute = "date", progress = TRUE) pb <- enrich(pb, p_attribute = "word") dtm <- as.DocumentTermMatrix(pb, col = "count")
#> ... using the p_attribute-slot of the first object in the bundle as p_attribute: word
#> ... generating (temporary) key column
#> ... generating cumulated data.table
#> ... getting unique keys
#> ... generating integer keys
#> ... cleaning up temporary key columns
summary(pb)
#> name size p_attribute unique #> 1 2009-10-27 9341 word 2239 #> 2 2009-10-28 2793 word 652 #> 3 2009-11-10 68316 word 8432 #> 4 2009-11-11 117614 word 12080 #> 5 2009-11-12 24137 word 4400
pb <- partition_bundle("GERMAPARLMINI", s_attribute = "date") # split up objects in partition_bundle by using partition_bundle-method use("polmineR")
#> ... activating corpus: GERMAPARLMINI (version: 0.0.1 | build date: 2019-02-23)
#> ... activating corpus: REUTERS
pb <- partition_bundle("GERMAPARLMINI", s_attribute = "date") pb2 <- partition_bundle(pb, s_attribute = "speaker", progress = FALSE) summary(pb2)
#> name size #> 1 2009-10-27_Gerda Hasselfeldt 23 #> 2 2009-10-27_Heinz Riesenhuber 4766 #> 3 2009-10-27_Hermann Otto Solms 17 #> 4 2009-10-27_Katrin Göring-Eckardt 17 #> 5 2009-10-27_Norbert Lammert 4441 #> 6 2009-10-27_Petra Pau 25 #> 7 2009-10-27_Volker Kauder 38 #> 8 2009-10-27_Wolfgang Thierse 14 #> 9 2009-10-28_Angela Dorothea Merkel 127 #> 10 2009-10-28_Annette Schavan 10 #> 11 2009-10-28_Dirk Niebel 10 #> 12 2009-10-28_Franz Josef Jung 10 #> 13 2009-10-28_Guido Westerwelle 10 #> 14 2009-10-28_Ilse Aigner 10 #> 15 2009-10-28_Karl-Theodor zu Guttenberg 10 #> 16 2009-10-28_Norbert Lammert 2519 #> 17 2009-10-28_Peter Ramsauer 10 #> 18 2009-10-28_Philipp Rösler 10 #> 19 2009-10-28_Rainer Brüderle 10 #> 20 2009-10-28_Ronald Pofalla 27 #> 21 2009-10-28_Sabine Leutheusser-Schnarrenberger 10 #> 22 2009-10-28_Ursula von der Leyen 10 #> 23 2009-10-28_Wolfgang Schäuble 10 #> 24 2009-11-10_Agnes Krumwiede 779 #> 25 2009-11-10_Andreas Schockenhoff 2825 #> 26 2009-11-10_Angela Dorothea Merkel 8988 #> 27 2009-11-10_Angelica Schwall-Düren 1230 #> 28 2009-11-10_Arnold Vaatz 1603 #> 29 2009-11-10_Birgit Homburger 4311 #> 30 2009-11-10_Caren Lay 702 #> 31 2009-11-10_Christel Happach-Kasan 1336 #> 32 2009-11-10_Dirk Niebel 1409 #> 33 2009-11-10_Elvira Drobinski-Weiß 1062 #> 34 2009-11-10_Frank-Walter Steinmeier 4476 #> 35 2009-11-10_Frithjof Schmidt 1264 #> 36 2009-11-10_Gerda Hasselfeldt 350 #> 37 2009-11-10_Gernot Erler 1210 #> 38 2009-11-10_Guido Westerwelle 1566 #> 39 2009-11-10_Hans-Michael Goldmann 1239 #> 40 2009-11-10_Hans-Peter Friedrich 759 #> 41 2009-11-10_Ilse Aigner 1321 #> 42 2009-11-10_Jan van Aken 1364 #> 43 2009-11-10_Joachim Poß 1772 #> 44 2009-11-10_Johannes Röring 1081 #> 45 2009-11-10_Jürgen Trittin 2477 #> 46 2009-11-10_Karl-Theodor zu Guttenberg 3016 #> 47 2009-11-10_Katrin Göring-Eckardt 519 #> 48 2009-11-10_Kirsten Tackmann 1009 #> 49 2009-11-10_Norbert Lammert 365 #> 50 2009-11-10_Omid Nouripour 812 #> 51 2009-11-10_Oskar Lafontaine 3337 #> 52 2009-11-10_Peter Bleser 1778 #> 53 2009-11-10_Petra Pau 81 #> 54 2009-11-10_Sascha Raabe 199 #> 55 2009-11-10_Ulrike Höfken 1374 #> 56 2009-11-10_Volker Kauder 3956 #> 57 2009-11-10_Waltraud Wolff 1490 #> 58 2009-11-10_Wilhelm Priesmeier 1252 #> 59 2009-11-10_Wolfgang Gehrcke 1291 #> 60 2009-11-10_Wolfgang Thierse 4713 #> 61 2009-11-11_Albert Rupprecht 1055 #> 62 2009-11-11_Annette Schavan 2048 #> 63 2009-11-11_Anton Schaaf 332 #> 64 2009-11-11_Bärbel Höhn 1671 #> 65 2009-11-11_Brigitte Pothmer 1795 #> 66 2009-11-11_Christine Lambrecht 1901 #> 67 2009-11-11_Dagmar Ziegler 4073 #> 68 2009-11-11_Daniela Raab 1506 #> 69 2009-11-11_Dieter Wiefelspütz 1268 #> 70 2009-11-11_Dirk Fischer 1301 #> 71 2009-11-11_Dorothée Menzner 772 #> 72 2009-11-11_Ekin Deligöz 1665 #> 73 2009-11-11_Elke Ferner 2053 #> 74 2009-11-11_Ernst Dieter Rossmann 1721 #> 75 2009-11-11_Eva Bulling-Schröter 854 #> 76 2009-11-11_Florian Pronold 1327 #> 77 2009-11-11_Frank Schwabe 1279 #> 78 2009-11-11_Franz Josef Jung 1653 #> 79 2009-11-11_Georg Nüßlein 2277 #> 80 2009-11-11_Gerda Hasselfeldt 636 #> 81 2009-11-11_Gisela Piltz 1775 #> 82 2009-11-11_Günter Krings 40 #> 83 2009-11-11_Halina Wawzyniak 524 #> 84 2009-11-11_Hans-Peter Uhl 1388 #> 85 2009-11-11_Hartfrid Wolff 1432 #> 86 2009-11-11_Heidrun Bluhm 1045 #> 87 2009-11-11_Heinrich Leonhard Kolb 2016 #> 88 2009-11-11_Hermann Otto Solms 4001 #> 89 2009-11-11_Horst Meierhofer 1366 #> 90 2009-11-11_Hubertus Heil 6117 #> 91 2009-11-11_Jens Petermann 641 #> 92 2009-11-11_Jerzy Montag 1431 #> 93 2009-11-11_Joachim Pfeiffer 2051 #> 94 2009-11-11_Johannes Vogel 1072 #> 95 2009-11-11_Jörn Wunderlich 1855 #> 96 2009-11-11_Josef Göppel 746 #> 97 2009-11-11_Karl Schiewerling 2018 #> 98 2009-11-11_Katja Kipping 821 #> 99 2009-11-11_Katrin Göring-Eckardt 4281 #> 100 2009-11-11_Kerstin Andreae 2097 #> 101 2009-11-11_Klaus Ernst 1236 #> 102 2009-11-11_Krista Sager 1451 #> 103 2009-11-11_Marco Bülow 1355 #> 104 2009-11-11_Marie-Luise Dött 1195 #> 105 2009-11-11_Markus Kurth 92 #> 106 2009-11-11_Martin Neumann 771 #> 107 2009-11-11_Max Straubinger 1578 #> 108 2009-11-11_Michael Franz Wilhelm Fuchs 2361 #> 109 2009-11-11_Michael Grosse-Brömer 1530 #> 110 2009-11-11_Michael Kauch 1274 #> 111 2009-11-11_Michael Kretschmer 1489 #> 112 2009-11-11_Miriam Gruß 1540 #> 113 2009-11-11_Norbert Lammert 1724 #> 114 2009-11-11_Norbert Röttgen 2670 #> 115 2009-11-11_Olaf Scholz 3741 #> 116 2009-11-11_Patrick Döring 2144 #> 117 2009-11-11_Patrick Meinhardt 1398 #> 118 2009-11-11_Peter Götz 882 #> 119 2009-11-11_Peter Ramsauer 2168 #> 120 2009-11-11_Petra Pau 229 #> 121 2009-11-11_Petra Sitte 1810 #> 122 2009-11-11_Rainer Brüderle 1367 #> 123 2009-11-11_Raju Sharma 536 #> 124 2009-11-11_Reinhard Grindel 1407 #> 125 2009-11-11_Sabine Leidig 1048 #> 126 2009-11-11_Sabine Leutheusser-Schnarrenberger 1338 #> 127 2009-11-11_Sahra Wagenknecht 1063 #> 128 2009-11-11_Sören Bartol 1158 #> 129 2009-11-11_Ulla Jelpke 589 #> 130 2009-11-11_Ulla Lötzer 707 #> 131 2009-11-11_Ulrich Kelber 1243 #> 132 2009-11-11_Ursula von der Leyen 1846 #> 133 2009-11-11_Uwe Karl Beckmeyer 1170 #> 134 2009-11-11_Volker Beck 121 #> 135 2009-11-11_Winfried Hermann 1601 #> 136 2009-11-11_Wolfgang Thierse 272 #> 137 2009-11-11_Wolfgang Wieland 1606 #> 138 2009-11-12_Alexander Bonde 1096 #> 139 2009-11-12_Barbara Hendricks 22 #> 140 2009-11-12_Birgitt Bender 979 #> 141 2009-11-12_Carl-Ludwig Thiele 1572 #> 142 2009-11-12_Carola Reimann 1299 #> 143 2009-11-12_Elisabeth Scharfenberg 845 #> 144 2009-11-12_Elke Ferner 2965 #> 145 2009-11-12_Gerda Hasselfeldt 1923 #> 146 2009-11-12_Gesine Lötzsch 1313 #> 147 2009-11-12_Hermann Otto Solms 53 #> 148 2009-11-12_Jens Spahn 1434 #> 149 2009-11-12_Joachim Poß 1573 #> 150 2009-11-12_Norbert Lammert 326 #> 151 2009-11-12_Philipp Rösler 1636 #> 152 2009-11-12_Rolf Koschorrek 1671 #> 153 2009-11-12_Ulrike Flach 876 #> 154 2009-11-12_Wolfgang Schäuble 2921 #> 155 2009-11-12_Wolfgang Zöller 1633