Managing Data Frames

Want to learn more? I recommend working through: R for Data Science, R Cookbook, and R Graphics Cookbook.

# Load LearningR package
library(learningr)
# Load english_monarchs data from the LearningR package
data(english_monarchs, package = "learningr")

Altering A Single Column

# Create a new column from the differece between two date columns
english_monarchs$length.of.reign.years <- with(
  english_monarchs,
  end.of.reign - start.of.reign
)
english_monarchs
                                           name               house
1                                         Wehha           Wuffingas
2                                         Wuffa           Wuffingas
3                                        Tytila           Wuffingas
4                                       Rædwald           Wuffingas
5                                      Eorpwald           Wuffingas
6                                      Ricberht           Wuffingas
7                          Sigeberht and Ecgric           Wuffingas
8                                        Ecgric           Wuffingas
9                                          Anna           Wuffingas
10                                    Æthelhere           Wuffingas
11                                    Æthelwold           Wuffingas
12                                     Ealdwulf           Wuffingas
13                                      Ælfwald           Wuffingas
14                      Hun, Beonna and Alberht           Wuffingas
15                                   Æthelred I           Wuffingas
16                                Æthelberht II           Wuffingas
17                                         Offa              Mercia
18                                         Offa              Mercia
19                            Offa and Ecgfrith              Mercia
20                                     Ecgfrith              Mercia
21                                      Eadwald         East Anglia
22                                 C\u009cnwulf              Mercia
23                    C\u009cnwulf and Cynehelm              Mercia
24                                 C\u009cnwulf              Mercia
25                                     Ceolwulf              Mercia
26                                    Beornwulf              Mercia
27                                    Æthelstan         East Anglia
28                                   Æthelweard         East Anglia
29                                       Edmund         East Anglia
30                                         <NA>                <NA>
31                                       Oswald               Norse
32                                  Æthelred II               Norse
33                                      Guthrum                Dane
34                                       Eohric                Dane
35                                    Æthelwold                Dane
36                                   Guthrum II                Dane
37                                     Aescwine          East Saxon
38                                       Sledda          East Saxon
39                                      Saebert          East Saxon
40                                      Saeward          East Saxon
41                         Sigeberht the Little          East Saxon
42                           Sigeberht the Good          East Saxon
43                                     Swithelm          East Saxon
44                            Sighere and Sebbi          East Saxon
45                                        Sebbi          East Saxon
46                                    Sigeheard          East Saxon
47                       Sigeheard and Swaefred          East Saxon
48                                         Offa          East Saxon
49                                      Saelred          East Saxon
50                                    Swaefbert          East Saxon
51                                         <NA>                <NA>
52                                    Svvithred          East Saxon
53                                      Sigeric          East Saxon
54                                      Sigered          East Saxon
55                                      Hengist                Kent
56                                        Horsa                Kent
57                                         Oisc                Kent
58                                         Octa                Kent
59                                    Eormenric                Kent
60                                  Æðelberht I                Kent
61                                      Eadbald                Kent
62                                     Æðelwald                Kent
63                    Eorcenberht and Eormenred                Kent
64                                  Eorcenberht                Kent
65                                   Ecgbehrt I                Kent
66                                    Hlothhere                Kent
67                                       Eadric                Kent
68                                          Mul                Kent
69                                    Swæfheard                Kent
70                 Oswine, Swæfbehrt, Swæfheard                Kent
71                Swæfbehrt, Swæfheard, Wihtred                Kent
72                                      Wihtred                Kent
73          Æðelberht II, Ælfric and Eadberht I                Kent
74                    Æðelberht II and Eardwulf                Kent
75             Eadberht II, Eanmund and Sigered                Kent
76                                     Heaberht                Kent
77                     Heaberht and Ecgbehrt II                Kent
78                                     Ealhmund                Kent
79                            Ecgbehrt III Præn                Kent
80                                       Cuðred                Kent
81                                      Baldred                Kent
82                       Ecgbehrt and Æthelwulf           Cerdicing
83                       Ecgbehrt and Æthelwulf           Cerdicing
84                       Ecgbehrt and Æthelwulf           Cerdicing
85                     Æthelwulf and Æðelstan I           Cerdicing
86                                    Æthelwulf           Cerdicing
87                  Æthelwulf and Æðelberht III           Cerdicing
88                                Æðelberht III           Cerdicing
89                                   Æthelred I           Cerdicing
90                                        Cearl              Mercia
91                                        Penda              Mercia
92                               Penda and Eowa              Mercia
93                                        Penda              Mercia
94                              Penda and Peada              Mercia
95                                        Oswiu            Bernicia
96                                     Wulfhere              Mercia
97                                   Æthelred I              Mercia
98                                      Coenred              Mercia
99                                      Ceolred              Mercia
100                                    Ceolwald              Mercia
101                                   Æthelbald              Mercia
102                                    Beornred              Mercia
103                                      Ludeca              Mercia
104                                      Wiglaf              Mercia
105                                      Wiglaf              Mercia
106                                     Wigmund              Mercia
107                                     Wigstan              Mercia
108                                     Ælfflæd              Mercia
109                                  Beorhtwulf              Mercia
110                                     Burgred              Mercia
111                                 Ceolwulf II              Mercia
112                                        <NA>              Mercia
113              Æthelred, Lord of the Mercians              Mercia
114             Æthelflæd, Lady of the Mercians              Mercia
115        Ælfwynn, Second Lady of the Mercians              Mercia
116                                         Esa            Bernicia
117                                       Eoppa            Bernicia
118                                         Ida            Bernicia
119                                      Glappa            Bernicia
120                                        Adda            Bernicia
121                                    Æthelric            Bernicia
122                                    Theodric            Bernicia
123                                  Frithuwald            Bernicia
124                                       Hussa            Bernicia
125                                  Æthelfrith            Bernicia
126                                       Edwin               Deira
127                                    Eanfrith            Bernicia
128                                      Oswald            Bernicia
129                                       Oswiu            Bernicia
130                                       Oswiu            Bernicia
131                                       Oswiu            Bernicia
132                                       Oswiu            Bernicia
133                                        Ælla               Deira
134                                    Æthelric               Deira
135                                       Osric               Deira
136                                      Oswine               Deira
137                                   Æthelwold               Deira
138                                   Alchfrith               Deira
139                                     Ælfwine               Deira
140                                    Ecgfrith         Northumbria
141                                    Aldfrith         Northumbria
142                                     Eadwulf         Northumbria
143                                     Osred I         Northumbria
144                                     Coenred         Northumbria
145                                       Osric         Northumbria
146                                    Coelwulf         Northumbria
147                                    Coelwulf         Northumbria
148                                    Eadberht         Northumbria
149                                      Oswulf         Northumbria
150                              Æthelwald Moll         Northumbria
151                                      Alhred         Northumbria
152                                  Æthelred I         Northumbria
153                                 Æthelwald I         Northumbria
154                                    Osred II         Northumbria
155                                  Æthelred I         Northumbria
156                                      Osbald         Northumbria
157                                    Eardwulf         Northumbria
158                                  Ælfwald II         Northumbria
159                                    Eardwulf         Northumbria
160                                      Eanred         Northumbria
161                                 Æthelred II         Northumbria
162                                     Rædwulf         Northumbria
163                                 Æthelred II         Northumbria
164                                     Osberht         Northumbria
165                                     Ælle II         Northumbria
166                                     Osberht         Northumbria
167                                  Ecgberht I               Norse
168                                     Ricsige               Norse
169                                 Ecgberht II               Norse
170                                     Guðroðr               Norse
171                                    Sigfroðr               Norse
172                                       Knútr               Norse
173                                   Æthelwold               Norse
174                          Hálfdan and Eowils               Norse
175                                  Eadwulf II               Norse
176                                     Ealdred               Norse
177                            Ragnall ua Ímair               Norse
178                              Sigtrygg Caech               Norse
179                          Amlaíb mac Gofraid               Norse
180                               Amlaíb Cuarán               Norse
181                         Ragnall mac Gofraid               Norse
182                                        Eric               Norse
183                               Amlaíb Cuarán               Norse
184                                        Eric               Norse
185                                      Eadred               Norse
186                                        Ælle         South Saxon
187                                       Cissa         South Saxon
188                                        <NA>                <NA>
189                                   Æðelwealh         South Saxon
190                                     Eadwulf         South Saxon
191                                     Ecgwald         South Saxon
192                                    Berhthun         South Saxon
193                                      Andhun         South Saxon
194                            Noðhelm and Watt              Wessex
195                           Noðhelm and Bryni              Wessex
196                           Noðhelm and Osric              Wessex
197                        Noðhelm and Æðelstan              Wessex
198                                    Æðelstan              Wessex
199                                        <NA>              Wessex
200                                        <NA>                <NA>
201                                   Æðelbehrt              Wessex
202                                      Osmund              Wessex
203                   Ælfwald, Oslac and Osmund              Wessex
204         Ælfwald, Ealdwulf, Oslac and Osmund              Mercia
205 Ælfwald, Ealdwulf, Oslac, Osmund and Oswald              Mercia
206                                    Ealdwulf              Mercia
207                                        <NA>                <NA>
208                                      Cerdic            Gewissae
209                                      Cynric            Gewissae
210                                     Ceawlin            Gewissae
211                                        Ceol            Gewissae
212                                    Ceolwulf            Gewissae
213                                    Cynegils            Gewissae
214                                    Cwichelm            Gewissae
215                                     Cenwalh            Gewissae
216                                       Penda              Mercia
217                                     Cenwalh           Cerdicing
218                        Cenwalh and Seaxburh           Cerdicing
219                                      Cenfus           Cerdicing
220                                     Æscwine           Cerdicing
221                                    Centwine           Cerdicing
222                                   Caedwalla           Cerdicing
223                                         Ine           Cerdicing
224                                  Æthelheard           Cerdicing
225                                     Cuthred           Cerdicing
226                                   Sigeberht           Cerdicing
227                                    Cynewulf           Cerdicing
228                                   Beorhtric           Cerdicing
229                                    Ecgbehrt           Cerdicing
230                                   Æthelbald           Cerdicing
231                                   Æthelbret           Cerdicing
232                            Alfred the Great           Cerdicing
233                            Edward the Elder           Cerdicing
234                                    Ælfweard           Cerdicing
235                                   Æthelstan           Cerdicing
236                                   Æthelstan              Wessex
237                                    Edmund I              Wessex
238                                      Eadred              Wessex
239                                      Eadwig              Wessex
240                          Edgar the Peaceful              Wessex
241                           Edward the Martyr              Wessex
242                        Æthelred the Unready              Wessex
243                             Sweyn Forkbeard           Knýtlinga
244                        Æthelred the Unready              Wessex
245                             Edmund Ironside              Wessex
246                                        Cnut           Knýtlinga
247                             Harold Harefoot           Knýtlinga
248                                  Harthacnut           Knýtlinga
249                        Edward the Confessor              Wessex
250                            Harold Godwinson              Wessex
251                          Edgar the Ætheling              Wessex
252                                   William I            Normandy
253                                  William II            Normandy
254                                     Henry I            Normandy
255                                     Stephen            Normandy
256                                     Matilda Plantagenet/Angevin
257                                     Stephen            Normandy
258                                    Henry II Plantagenet/Angevin
259                                   Richard I Plantagenet/Angevin
    start.of.reign end.of.reign                    domain length.of.reign.years
1               NA          571               East Anglia                    NA
2              571          578               East Anglia                     7
3              578          616               East Anglia                    38
4              616          627               East Anglia                    11
5              627          627               East Anglia                     0
6              627          630               East Anglia                     3
7              630          634               East Anglia                     4
8              634           NA               East Anglia                    NA
9               NA          653               East Anglia                    NA
10             653          655               East Anglia                     2
11             655          663               East Anglia                     8
12             663          713               East Anglia                    50
13             713          749               East Anglia                    36
14             749           NA               East Anglia                    NA
15              NA          779               East Anglia                    NA
16             779          794               East Anglia                    15
17             757          785       East Anglia, Mercia                    28
18             785          787 East Anglia, Kent, Mercia                     2
19             787          796 East Anglia, Kent, Mercia                     9
20             796          796 East Anglia, Kent, Mercia                     0
21             796          800               East Anglia                     4
22             796          798 East Anglia, Kent, Mercia                     2
23             798          812 East Anglia, Kent, Mercia                    14
24             812          821 East Anglia, Kent, Mercia                     9
25             821          823 East Anglia, Kent, Mercia                     2
26             823          826       East Anglia, Mercia                     3
27             826          845               East Anglia                    19
28             845          855               East Anglia                    10
29             855          869               East Anglia                    14
30             869          875               East Anglia                     6
31             875          875               East Anglia                     0
32             875          879               East Anglia                     4
33             879          890               East Anglia                    11
34             890          902               East Anglia                    12
35             902          902               East Anglia                     0
36             902          918               East Anglia                    16
37             527          587                     Essex                    60
38             587          604                     Essex                    17
39             604          616                     Essex                    12
40             616          617                     Essex                     1
41             617          653                     Essex                    36
42             653          660                     Essex                     7
43             660          664                     Essex                     4
44             664          683                     Essex                    19
45             683          694                     Essex                    11
46             694          695                     Essex                     1
47             695          709                     Essex                    14
48             709          709                     Essex                     0
49             709          715                     Essex                     6
50             715          738                     Essex                    23
51             738          746                     Essex                     8
52             746          758                     Essex                    12
53             758          798                     Essex                    40
54             798          812                     Essex                    14
55              NA           NA                      Kent                    NA
56              NA           NA                      Kent                    NA
57              NA           NA                      Kent                    NA
58             512          534                      Kent                    22
59             534          590                      Kent                    56
60             590          616                      Kent                    26
61             616          640                      Kent                    24
62              NA           NA                      Kent                    NA
63             640           NA                      Kent                    NA
64              NA          664                      Kent                    NA
65             664          673                      Kent                     9
66             674          685                      Kent                    11
67             685          686                      Kent                     1
68             686          687                      Kent                     1
69             687          689                      Kent                     2
70             689          690                      Kent                     1
71             689          692                      Kent                     3
72             692          725                      Kent                    33
73             725          748                      Kent                    23
74             748          762                      Kent                    14
75             762          764                      Kent                     2
76             764          765                      Kent                     1
77             765          779                      Kent                    14
78              NA          785                      Kent                    NA
79             796          798                      Kent                     2
80             798          807                      Kent                     9
81             823          825                      Kent                     2
82             825          829              Kent, Wessex                     4
83             829          830      Kent, Mercia, Wessex                     1
84             830          839              Kent, Wessex                     9
85             839          851              Kent, Wessex                    12
86             851          855              Kent, Wessex                     4
87             855          858              Kent, Wessex                     3
88             858          866              Kent, Wessex                     8
89             866          871              Kent, Wessex                     5
90             606           NA                    Mercia                    NA
91             626          635                    Mercia                     9
92             635          642                    Mercia                     7
93             642          653                    Mercia                    11
94             653          655                    Mercia                     2
95             655          658       Mercia, Northumbria                     3
96             658          675                    Mercia                    17
97             675          704                    Mercia                    29
98             704          709                    Mercia                     5
99             709          716                    Mercia                     7
100            716          716                    Mercia                     0
101            716          757                    Mercia                    41
102            757          757                    Mercia                     0
103            826          827                    Mercia                     1
104            827          829                    Mercia                     2
105            830          839                    Mercia                     9
106            839          840                    Mercia                     1
107            840          840                    Mercia                     0
108            840          840                    Mercia                     0
109            840          852                    Mercia                    12
110            852          874                    Mercia                    22
111            874          879                    Mercia                     5
112            879          883                    Mercia                     4
113            883          911                    Mercia                    28
114            911          918                    Mercia                     7
115            918          918                    Mercia                     0
116            500          520                  Bernicia                    20
117            520          547                  Bernicia                    27
118            547          559                  Bernicia                    12
119            559          560                  Bernicia                     1
120            560          568                  Bernicia                     8
121            568          572                  Bernicia                     4
122            572          579                  Bernicia                     7
123            579          585                  Bernicia                     6
124            585          593                  Bernicia                     8
125            593          616               Northumbria                    23
126            616          632               Northumbria                    16
127            632          633                  Bernicia                     1
128            634          642               Northumbria                     8
129            642          644               Northumbria                     2
130            644          654                  Bernicia                    10
131            654          655               Northumbria                     1
132            658          670               Northumbria                    12
133            559          589                     Deira                    30
134            589          604                     Deira                    15
135            633          634                     Deira                     1
136            644          651               Northumbria                     7
137            651          654               Northumbria                     3
138            656          664                     Deira                     8
139            670          679                     Deira                     9
140            670          685               Northumbria                    15
141            685          704               Northumbria                    19
142            704          705               Northumbria                     1
143            705          716               Northumbria                    11
144            716          718               Northumbria                     2
145            718          729               Northumbria                    11
146            729          731               Northumbria                     2
147            731          737               Northumbria                     6
148            737          758               Northumbria                    21
149            758          759               Northumbria                     1
150            759          765               Northumbria                     6
151            765          774               Northumbria                     9
152            774          779               Northumbria                     5
153            779          788               Northumbria                     9
154            788          790               Northumbria                     2
155            790          796               Northumbria                     6
156            796          796               Northumbria                     0
157            796          806               Northumbria                    10
158            806          808               Northumbria                     2
159            808          810               Northumbria                     2
160            810          841               Northumbria                    31
161            841          844               Northumbria                     3
162            844          844               Northumbria                     0
163            844          849               Northumbria                     5
164            849          862               Northumbria                    13
165            862          867               Northumbria                     5
166            867          867               Northumbria                     0
167            867          872               Northumbria                     5
168            872          876               Northumbria                     4
169            876          878               Northumbria                     2
170            878          895               Northumbria                    17
171             NA           NA               Northumbria                    NA
172             NA           NA               Northumbria                    NA
173            900          902               Northumbria                     2
174            902          910               Northumbria                     8
175            910          913               Northumbria                     3
176            913          918               Northumbria                     5
177            914          921               Northumbria                     7
178            921          927               Northumbria                     6
179            939          941               Northumbria                     2
180            941          944               Northumbria                     3
181            943          944               Northumbria                     1
182            947          948               Northumbria                     1
183            949          952               Northumbria                     3
184            952          954               Northumbria                     2
185            954          954               Northumbria                     0
186            477          514                    Sussex                    37
187            514          567                    Sussex                    53
188            567          660                    Sussex                    93
189            660          685                    Sussex                    25
190            683          683                    Sussex                     0
191            683          685                    Sussex                     2
192            685           NA                    Sussex                    NA
193            685           NA                    Sussex                    NA
194            692          700                    Sussex                     8
195            700          710                    Sussex                    10
196            710          717                    Sussex                     7
197            717          717                    Sussex                     0
198            717          724                    Sussex                     7
199            724          726                    Sussex                     2
200            726          740                    Sussex                    14
201            740           NA                    Sussex                    NA
202            760          765                    Sussex                     5
203            765          771                    Sussex                     6
204            771          772                    Sussex                     1
205            772          772                    Sussex                     0
206            772          791                    Sussex                    19
207            791          825                    Sussex                    34
208            519          534                    Wessex                    15
209            534          560                    Wessex                    26
210            560          591                    Wessex                    31
211            591          597                    Wessex                     6
212            597          611                    Wessex                    14
213            611          643                    Wessex                    32
214            626          636                    Wessex                    10
215            643          645                    Wessex                     2
216            645          648                    Wessex                     3
217            648          672                    Wessex                    24
218            672          674                    Wessex                     2
219            674          674                    Wessex                     0
220            674          676                    Wessex                     2
221            676          685                    Wessex                     9
222            685          688                    Wessex                     3
223            688          726                    Wessex                    38
224            726          740                    Wessex                    14
225            740          756                    Wessex                    16
226            756          757                    Wessex                     1
227            757          786                    Wessex                    29
228            786          802                    Wessex                    16
229            802          825                    Wessex                    23
230            858          860                    Wessex                     2
231            860          865                    Wessex                     5
232            871          899                    Wessex                    28
233            899          924                    Wessex                    25
234            924          924                    Wessex                     0
235            924          927                    Wessex                     3
236            927          939                   England                    12
237            939          946                   England                     7
238            946          955                   England                     9
239            955          959                   England                     4
240            959          975                   England                    16
241            975          978                   England                     3
242            978         1013                   England                    35
243           1013         1014                   England                     1
244           1014         1016                   England                     2
245           1016         1016                   England                     0
246           1016         1035                   England                    19
247           1035         1040                   England                     5
248           1040         1042                   England                     2
249           1042         1066                   England                    24
250           1066         1066                   England                     0
251           1066         1066                   England                     0
252           1066         1087                   England                    21
253           1087         1100                   England                    13
254           1100         1135                   England                    35
255           1135         1141                   England                     6
256           1141         1141                   England                     0
257           1141         1154                   England                    13
258           1154         1189                   England                    35
259           1189         1199                   England                    10

Altering Multiple Columns

# Within the english_monarchs dataframe, create two new columns
english_monarchs <- within(
  english_monarchs,
{
  length.of.reign.years <- end.of.reign - start.of.reign
  reign.was.more.than.30.years <- length.of.reign.years > 30
}
)
english_monarchs
                                           name               house
1                                         Wehha           Wuffingas
2                                         Wuffa           Wuffingas
3                                        Tytila           Wuffingas
4                                       Rædwald           Wuffingas
5                                      Eorpwald           Wuffingas
6                                      Ricberht           Wuffingas
7                          Sigeberht and Ecgric           Wuffingas
8                                        Ecgric           Wuffingas
9                                          Anna           Wuffingas
10                                    Æthelhere           Wuffingas
11                                    Æthelwold           Wuffingas
12                                     Ealdwulf           Wuffingas
13                                      Ælfwald           Wuffingas
14                      Hun, Beonna and Alberht           Wuffingas
15                                   Æthelred I           Wuffingas
16                                Æthelberht II           Wuffingas
17                                         Offa              Mercia
18                                         Offa              Mercia
19                            Offa and Ecgfrith              Mercia
20                                     Ecgfrith              Mercia
21                                      Eadwald         East Anglia
22                                 C\u009cnwulf              Mercia
23                    C\u009cnwulf and Cynehelm              Mercia
24                                 C\u009cnwulf              Mercia
25                                     Ceolwulf              Mercia
26                                    Beornwulf              Mercia
27                                    Æthelstan         East Anglia
28                                   Æthelweard         East Anglia
29                                       Edmund         East Anglia
30                                         <NA>                <NA>
31                                       Oswald               Norse
32                                  Æthelred II               Norse
33                                      Guthrum                Dane
34                                       Eohric                Dane
35                                    Æthelwold                Dane
36                                   Guthrum II                Dane
37                                     Aescwine          East Saxon
38                                       Sledda          East Saxon
39                                      Saebert          East Saxon
40                                      Saeward          East Saxon
41                         Sigeberht the Little          East Saxon
42                           Sigeberht the Good          East Saxon
43                                     Swithelm          East Saxon
44                            Sighere and Sebbi          East Saxon
45                                        Sebbi          East Saxon
46                                    Sigeheard          East Saxon
47                       Sigeheard and Swaefred          East Saxon
48                                         Offa          East Saxon
49                                      Saelred          East Saxon
50                                    Swaefbert          East Saxon
51                                         <NA>                <NA>
52                                    Svvithred          East Saxon
53                                      Sigeric          East Saxon
54                                      Sigered          East Saxon
55                                      Hengist                Kent
56                                        Horsa                Kent
57                                         Oisc                Kent
58                                         Octa                Kent
59                                    Eormenric                Kent
60                                  Æðelberht I                Kent
61                                      Eadbald                Kent
62                                     Æðelwald                Kent
63                    Eorcenberht and Eormenred                Kent
64                                  Eorcenberht                Kent
65                                   Ecgbehrt I                Kent
66                                    Hlothhere                Kent
67                                       Eadric                Kent
68                                          Mul                Kent
69                                    Swæfheard                Kent
70                 Oswine, Swæfbehrt, Swæfheard                Kent
71                Swæfbehrt, Swæfheard, Wihtred                Kent
72                                      Wihtred                Kent
73          Æðelberht II, Ælfric and Eadberht I                Kent
74                    Æðelberht II and Eardwulf                Kent
75             Eadberht II, Eanmund and Sigered                Kent
76                                     Heaberht                Kent
77                     Heaberht and Ecgbehrt II                Kent
78                                     Ealhmund                Kent
79                            Ecgbehrt III Præn                Kent
80                                       Cuðred                Kent
81                                      Baldred                Kent
82                       Ecgbehrt and Æthelwulf           Cerdicing
83                       Ecgbehrt and Æthelwulf           Cerdicing
84                       Ecgbehrt and Æthelwulf           Cerdicing
85                     Æthelwulf and Æðelstan I           Cerdicing
86                                    Æthelwulf           Cerdicing
87                  Æthelwulf and Æðelberht III           Cerdicing
88                                Æðelberht III           Cerdicing
89                                   Æthelred I           Cerdicing
90                                        Cearl              Mercia
91                                        Penda              Mercia
92                               Penda and Eowa              Mercia
93                                        Penda              Mercia
94                              Penda and Peada              Mercia
95                                        Oswiu            Bernicia
96                                     Wulfhere              Mercia
97                                   Æthelred I              Mercia
98                                      Coenred              Mercia
99                                      Ceolred              Mercia
100                                    Ceolwald              Mercia
101                                   Æthelbald              Mercia
102                                    Beornred              Mercia
103                                      Ludeca              Mercia
104                                      Wiglaf              Mercia
105                                      Wiglaf              Mercia
106                                     Wigmund              Mercia
107                                     Wigstan              Mercia
108                                     Ælfflæd              Mercia
109                                  Beorhtwulf              Mercia
110                                     Burgred              Mercia
111                                 Ceolwulf II              Mercia
112                                        <NA>              Mercia
113              Æthelred, Lord of the Mercians              Mercia
114             Æthelflæd, Lady of the Mercians              Mercia
115        Ælfwynn, Second Lady of the Mercians              Mercia
116                                         Esa            Bernicia
117                                       Eoppa            Bernicia
118                                         Ida            Bernicia
119                                      Glappa            Bernicia
120                                        Adda            Bernicia
121                                    Æthelric            Bernicia
122                                    Theodric            Bernicia
123                                  Frithuwald            Bernicia
124                                       Hussa            Bernicia
125                                  Æthelfrith            Bernicia
126                                       Edwin               Deira
127                                    Eanfrith            Bernicia
128                                      Oswald            Bernicia
129                                       Oswiu            Bernicia
130                                       Oswiu            Bernicia
131                                       Oswiu            Bernicia
132                                       Oswiu            Bernicia
133                                        Ælla               Deira
134                                    Æthelric               Deira
135                                       Osric               Deira
136                                      Oswine               Deira
137                                   Æthelwold               Deira
138                                   Alchfrith               Deira
139                                     Ælfwine               Deira
140                                    Ecgfrith         Northumbria
141                                    Aldfrith         Northumbria
142                                     Eadwulf         Northumbria
143                                     Osred I         Northumbria
144                                     Coenred         Northumbria
145                                       Osric         Northumbria
146                                    Coelwulf         Northumbria
147                                    Coelwulf         Northumbria
148                                    Eadberht         Northumbria
149                                      Oswulf         Northumbria
150                              Æthelwald Moll         Northumbria
151                                      Alhred         Northumbria
152                                  Æthelred I         Northumbria
153                                 Æthelwald I         Northumbria
154                                    Osred II         Northumbria
155                                  Æthelred I         Northumbria
156                                      Osbald         Northumbria
157                                    Eardwulf         Northumbria
158                                  Ælfwald II         Northumbria
159                                    Eardwulf         Northumbria
160                                      Eanred         Northumbria
161                                 Æthelred II         Northumbria
162                                     Rædwulf         Northumbria
163                                 Æthelred II         Northumbria
164                                     Osberht         Northumbria
165                                     Ælle II         Northumbria
166                                     Osberht         Northumbria
167                                  Ecgberht I               Norse
168                                     Ricsige               Norse
169                                 Ecgberht II               Norse
170                                     Guðroðr               Norse
171                                    Sigfroðr               Norse
172                                       Knútr               Norse
173                                   Æthelwold               Norse
174                          Hálfdan and Eowils               Norse
175                                  Eadwulf II               Norse
176                                     Ealdred               Norse
177                            Ragnall ua Ímair               Norse
178                              Sigtrygg Caech               Norse
179                          Amlaíb mac Gofraid               Norse
180                               Amlaíb Cuarán               Norse
181                         Ragnall mac Gofraid               Norse
182                                        Eric               Norse
183                               Amlaíb Cuarán               Norse
184                                        Eric               Norse
185                                      Eadred               Norse
186                                        Ælle         South Saxon
187                                       Cissa         South Saxon
188                                        <NA>                <NA>
189                                   Æðelwealh         South Saxon
190                                     Eadwulf         South Saxon
191                                     Ecgwald         South Saxon
192                                    Berhthun         South Saxon
193                                      Andhun         South Saxon
194                            Noðhelm and Watt              Wessex
195                           Noðhelm and Bryni              Wessex
196                           Noðhelm and Osric              Wessex
197                        Noðhelm and Æðelstan              Wessex
198                                    Æðelstan              Wessex
199                                        <NA>              Wessex
200                                        <NA>                <NA>
201                                   Æðelbehrt              Wessex
202                                      Osmund              Wessex
203                   Ælfwald, Oslac and Osmund              Wessex
204         Ælfwald, Ealdwulf, Oslac and Osmund              Mercia
205 Ælfwald, Ealdwulf, Oslac, Osmund and Oswald              Mercia
206                                    Ealdwulf              Mercia
207                                        <NA>                <NA>
208                                      Cerdic            Gewissae
209                                      Cynric            Gewissae
210                                     Ceawlin            Gewissae
211                                        Ceol            Gewissae
212                                    Ceolwulf            Gewissae
213                                    Cynegils            Gewissae
214                                    Cwichelm            Gewissae
215                                     Cenwalh            Gewissae
216                                       Penda              Mercia
217                                     Cenwalh           Cerdicing
218                        Cenwalh and Seaxburh           Cerdicing
219                                      Cenfus           Cerdicing
220                                     Æscwine           Cerdicing
221                                    Centwine           Cerdicing
222                                   Caedwalla           Cerdicing
223                                         Ine           Cerdicing
224                                  Æthelheard           Cerdicing
225                                     Cuthred           Cerdicing
226                                   Sigeberht           Cerdicing
227                                    Cynewulf           Cerdicing
228                                   Beorhtric           Cerdicing
229                                    Ecgbehrt           Cerdicing
230                                   Æthelbald           Cerdicing
231                                   Æthelbret           Cerdicing
232                            Alfred the Great           Cerdicing
233                            Edward the Elder           Cerdicing
234                                    Ælfweard           Cerdicing
235                                   Æthelstan           Cerdicing
236                                   Æthelstan              Wessex
237                                    Edmund I              Wessex
238                                      Eadred              Wessex
239                                      Eadwig              Wessex
240                          Edgar the Peaceful              Wessex
241                           Edward the Martyr              Wessex
242                        Æthelred the Unready              Wessex
243                             Sweyn Forkbeard           Knýtlinga
244                        Æthelred the Unready              Wessex
245                             Edmund Ironside              Wessex
246                                        Cnut           Knýtlinga
247                             Harold Harefoot           Knýtlinga
248                                  Harthacnut           Knýtlinga
249                        Edward the Confessor              Wessex
250                            Harold Godwinson              Wessex
251                          Edgar the Ætheling              Wessex
252                                   William I            Normandy
253                                  William II            Normandy
254                                     Henry I            Normandy
255                                     Stephen            Normandy
256                                     Matilda Plantagenet/Angevin
257                                     Stephen            Normandy
258                                    Henry II Plantagenet/Angevin
259                                   Richard I Plantagenet/Angevin
    start.of.reign end.of.reign                    domain length.of.reign.years
1               NA          571               East Anglia                    NA
2              571          578               East Anglia                     7
3              578          616               East Anglia                    38
4              616          627               East Anglia                    11
5              627          627               East Anglia                     0
6              627          630               East Anglia                     3
7              630          634               East Anglia                     4
8              634           NA               East Anglia                    NA
9               NA          653               East Anglia                    NA
10             653          655               East Anglia                     2
11             655          663               East Anglia                     8
12             663          713               East Anglia                    50
13             713          749               East Anglia                    36
14             749           NA               East Anglia                    NA
15              NA          779               East Anglia                    NA
16             779          794               East Anglia                    15
17             757          785       East Anglia, Mercia                    28
18             785          787 East Anglia, Kent, Mercia                     2
19             787          796 East Anglia, Kent, Mercia                     9
20             796          796 East Anglia, Kent, Mercia                     0
21             796          800               East Anglia                     4
22             796          798 East Anglia, Kent, Mercia                     2
23             798          812 East Anglia, Kent, Mercia                    14
24             812          821 East Anglia, Kent, Mercia                     9
25             821          823 East Anglia, Kent, Mercia                     2
26             823          826       East Anglia, Mercia                     3
27             826          845               East Anglia                    19
28             845          855               East Anglia                    10
29             855          869               East Anglia                    14
30             869          875               East Anglia                     6
31             875          875               East Anglia                     0
32             875          879               East Anglia                     4
33             879          890               East Anglia                    11
34             890          902               East Anglia                    12
35             902          902               East Anglia                     0
36             902          918               East Anglia                    16
37             527          587                     Essex                    60
38             587          604                     Essex                    17
39             604          616                     Essex                    12
40             616          617                     Essex                     1
41             617          653                     Essex                    36
42             653          660                     Essex                     7
43             660          664                     Essex                     4
44             664          683                     Essex                    19
45             683          694                     Essex                    11
46             694          695                     Essex                     1
47             695          709                     Essex                    14
48             709          709                     Essex                     0
49             709          715                     Essex                     6
50             715          738                     Essex                    23
51             738          746                     Essex                     8
52             746          758                     Essex                    12
53             758          798                     Essex                    40
54             798          812                     Essex                    14
55              NA           NA                      Kent                    NA
56              NA           NA                      Kent                    NA
57              NA           NA                      Kent                    NA
58             512          534                      Kent                    22
59             534          590                      Kent                    56
60             590          616                      Kent                    26
61             616          640                      Kent                    24
62              NA           NA                      Kent                    NA
63             640           NA                      Kent                    NA
64              NA          664                      Kent                    NA
65             664          673                      Kent                     9
66             674          685                      Kent                    11
67             685          686                      Kent                     1
68             686          687                      Kent                     1
69             687          689                      Kent                     2
70             689          690                      Kent                     1
71             689          692                      Kent                     3
72             692          725                      Kent                    33
73             725          748                      Kent                    23
74             748          762                      Kent                    14
75             762          764                      Kent                     2
76             764          765                      Kent                     1
77             765          779                      Kent                    14
78              NA          785                      Kent                    NA
79             796          798                      Kent                     2
80             798          807                      Kent                     9
81             823          825                      Kent                     2
82             825          829              Kent, Wessex                     4
83             829          830      Kent, Mercia, Wessex                     1
84             830          839              Kent, Wessex                     9
85             839          851              Kent, Wessex                    12
86             851          855              Kent, Wessex                     4
87             855          858              Kent, Wessex                     3
88             858          866              Kent, Wessex                     8
89             866          871              Kent, Wessex                     5
90             606           NA                    Mercia                    NA
91             626          635                    Mercia                     9
92             635          642                    Mercia                     7
93             642          653                    Mercia                    11
94             653          655                    Mercia                     2
95             655          658       Mercia, Northumbria                     3
96             658          675                    Mercia                    17
97             675          704                    Mercia                    29
98             704          709                    Mercia                     5
99             709          716                    Mercia                     7
100            716          716                    Mercia                     0
101            716          757                    Mercia                    41
102            757          757                    Mercia                     0
103            826          827                    Mercia                     1
104            827          829                    Mercia                     2
105            830          839                    Mercia                     9
106            839          840                    Mercia                     1
107            840          840                    Mercia                     0
108            840          840                    Mercia                     0
109            840          852                    Mercia                    12
110            852          874                    Mercia                    22
111            874          879                    Mercia                     5
112            879          883                    Mercia                     4
113            883          911                    Mercia                    28
114            911          918                    Mercia                     7
115            918          918                    Mercia                     0
116            500          520                  Bernicia                    20
117            520          547                  Bernicia                    27
118            547          559                  Bernicia                    12
119            559          560                  Bernicia                     1
120            560          568                  Bernicia                     8
121            568          572                  Bernicia                     4
122            572          579                  Bernicia                     7
123            579          585                  Bernicia                     6
124            585          593                  Bernicia                     8
125            593          616               Northumbria                    23
126            616          632               Northumbria                    16
127            632          633                  Bernicia                     1
128            634          642               Northumbria                     8
129            642          644               Northumbria                     2
130            644          654                  Bernicia                    10
131            654          655               Northumbria                     1
132            658          670               Northumbria                    12
133            559          589                     Deira                    30
134            589          604                     Deira                    15
135            633          634                     Deira                     1
136            644          651               Northumbria                     7
137            651          654               Northumbria                     3
138            656          664                     Deira                     8
139            670          679                     Deira                     9
140            670          685               Northumbria                    15
141            685          704               Northumbria                    19
142            704          705               Northumbria                     1
143            705          716               Northumbria                    11
144            716          718               Northumbria                     2
145            718          729               Northumbria                    11
146            729          731               Northumbria                     2
147            731          737               Northumbria                     6
148            737          758               Northumbria                    21
149            758          759               Northumbria                     1
150            759          765               Northumbria                     6
151            765          774               Northumbria                     9
152            774          779               Northumbria                     5
153            779          788               Northumbria                     9
154            788          790               Northumbria                     2
155            790          796               Northumbria                     6
156            796          796               Northumbria                     0
157            796          806               Northumbria                    10
158            806          808               Northumbria                     2
159            808          810               Northumbria                     2
160            810          841               Northumbria                    31
161            841          844               Northumbria                     3
162            844          844               Northumbria                     0
163            844          849               Northumbria                     5
164            849          862               Northumbria                    13
165            862          867               Northumbria                     5
166            867          867               Northumbria                     0
167            867          872               Northumbria                     5
168            872          876               Northumbria                     4
169            876          878               Northumbria                     2
170            878          895               Northumbria                    17
171             NA           NA               Northumbria                    NA
172             NA           NA               Northumbria                    NA
173            900          902               Northumbria                     2
174            902          910               Northumbria                     8
175            910          913               Northumbria                     3
176            913          918               Northumbria                     5
177            914          921               Northumbria                     7
178            921          927               Northumbria                     6
179            939          941               Northumbria                     2
180            941          944               Northumbria                     3
181            943          944               Northumbria                     1
182            947          948               Northumbria                     1
183            949          952               Northumbria                     3
184            952          954               Northumbria                     2
185            954          954               Northumbria                     0
186            477          514                    Sussex                    37
187            514          567                    Sussex                    53
188            567          660                    Sussex                    93
189            660          685                    Sussex                    25
190            683          683                    Sussex                     0
191            683          685                    Sussex                     2
192            685           NA                    Sussex                    NA
193            685           NA                    Sussex                    NA
194            692          700                    Sussex                     8
195            700          710                    Sussex                    10
196            710          717                    Sussex                     7
197            717          717                    Sussex                     0
198            717          724                    Sussex                     7
199            724          726                    Sussex                     2
200            726          740                    Sussex                    14
201            740           NA                    Sussex                    NA
202            760          765                    Sussex                     5
203            765          771                    Sussex                     6
204            771          772                    Sussex                     1
205            772          772                    Sussex                     0
206            772          791                    Sussex                    19
207            791          825                    Sussex                    34
208            519          534                    Wessex                    15
209            534          560                    Wessex                    26
210            560          591                    Wessex                    31
211            591          597                    Wessex                     6
212            597          611                    Wessex                    14
213            611          643                    Wessex                    32
214            626          636                    Wessex                    10
215            643          645                    Wessex                     2
216            645          648                    Wessex                     3
217            648          672                    Wessex                    24
218            672          674                    Wessex                     2
219            674          674                    Wessex                     0
220            674          676                    Wessex                     2
221            676          685                    Wessex                     9
222            685          688                    Wessex                     3
223            688          726                    Wessex                    38
224            726          740                    Wessex                    14
225            740          756                    Wessex                    16
226            756          757                    Wessex                     1
227            757          786                    Wessex                    29
228            786          802                    Wessex                    16
229            802          825                    Wessex                    23
230            858          860                    Wessex                     2
231            860          865                    Wessex                     5
232            871          899                    Wessex                    28
233            899          924                    Wessex                    25
234            924          924                    Wessex                     0
235            924          927                    Wessex                     3
236            927          939                   England                    12
237            939          946                   England                     7
238            946          955                   England                     9
239            955          959                   England                     4
240            959          975                   England                    16
241            975          978                   England                     3
242            978         1013                   England                    35
243           1013         1014                   England                     1
244           1014         1016                   England                     2
245           1016         1016                   England                     0
246           1016         1035                   England                    19
247           1035         1040                   England                     5
248           1040         1042                   England                     2
249           1042         1066                   England                    24
250           1066         1066                   England                     0
251           1066         1066                   England                     0
252           1066         1087                   England                    21
253           1087         1100                   England                    13
254           1100         1135                   England                    35
255           1135         1141                   England                     6
256           1141         1141                   England                     0
257           1141         1154                   England                    13
258           1154         1189                   England                    35
259           1189         1199                   England                    10
    reign.was.more.than.30.years
1                             NA
2                          FALSE
3                           TRUE
4                          FALSE
5                          FALSE
6                          FALSE
7                          FALSE
8                             NA
9                             NA
10                         FALSE
11                         FALSE
12                          TRUE
13                          TRUE
14                            NA
15                            NA
16                         FALSE
17                         FALSE
18                         FALSE
19                         FALSE
20                         FALSE
21                         FALSE
22                         FALSE
23                         FALSE
24                         FALSE
25                         FALSE
26                         FALSE
27                         FALSE
28                         FALSE
29                         FALSE
30                         FALSE
31                         FALSE
32                         FALSE
33                         FALSE
34                         FALSE
35                         FALSE
36                         FALSE
37                          TRUE
38                         FALSE
39                         FALSE
40                         FALSE
41                          TRUE
42                         FALSE
43                         FALSE
44                         FALSE
45                         FALSE
46                         FALSE
47                         FALSE
48                         FALSE
49                         FALSE
50                         FALSE
51                         FALSE
52                         FALSE
53                          TRUE
54                         FALSE
55                            NA
56                            NA
57                            NA
58                         FALSE
59                          TRUE
60                         FALSE
61                         FALSE
62                            NA
63                            NA
64                            NA
65                         FALSE
66                         FALSE
67                         FALSE
68                         FALSE
69                         FALSE
70                         FALSE
71                         FALSE
72                          TRUE
73                         FALSE
74                         FALSE
75                         FALSE
76                         FALSE
77                         FALSE
78                            NA
79                         FALSE
80                         FALSE
81                         FALSE
82                         FALSE
83                         FALSE
84                         FALSE
85                         FALSE
86                         FALSE
87                         FALSE
88                         FALSE
89                         FALSE
90                            NA
91                         FALSE
92                         FALSE
93                         FALSE
94                         FALSE
95                         FALSE
96                         FALSE
97                         FALSE
98                         FALSE
99                         FALSE
100                        FALSE
101                         TRUE
102                        FALSE
103                        FALSE
104                        FALSE
105                        FALSE
106                        FALSE
107                        FALSE
108                        FALSE
109                        FALSE
110                        FALSE
111                        FALSE
112                        FALSE
113                        FALSE
114                        FALSE
115                        FALSE
116                        FALSE
117                        FALSE
118                        FALSE
119                        FALSE
120                        FALSE
121                        FALSE
122                        FALSE
123                        FALSE
124                        FALSE
125                        FALSE
126                        FALSE
127                        FALSE
128                        FALSE
129                        FALSE
130                        FALSE
131                        FALSE
132                        FALSE
133                        FALSE
134                        FALSE
135                        FALSE
136                        FALSE
137                        FALSE
138                        FALSE
139                        FALSE
140                        FALSE
141                        FALSE
142                        FALSE
143                        FALSE
144                        FALSE
145                        FALSE
146                        FALSE
147                        FALSE
148                        FALSE
149                        FALSE
150                        FALSE
151                        FALSE
152                        FALSE
153                        FALSE
154                        FALSE
155                        FALSE
156                        FALSE
157                        FALSE
158                        FALSE
159                        FALSE
160                         TRUE
161                        FALSE
162                        FALSE
163                        FALSE
164                        FALSE
165                        FALSE
166                        FALSE
167                        FALSE
168                        FALSE
169                        FALSE
170                        FALSE
171                           NA
172                           NA
173                        FALSE
174                        FALSE
175                        FALSE
176                        FALSE
177                        FALSE
178                        FALSE
179                        FALSE
180                        FALSE
181                        FALSE
182                        FALSE
183                        FALSE
184                        FALSE
185                        FALSE
186                         TRUE
187                         TRUE
188                         TRUE
189                        FALSE
190                        FALSE
191                        FALSE
192                           NA
193                           NA
194                        FALSE
195                        FALSE
196                        FALSE
197                        FALSE
198                        FALSE
199                        FALSE
200                        FALSE
201                           NA
202                        FALSE
203                        FALSE
204                        FALSE
205                        FALSE
206                        FALSE
207                         TRUE
208                        FALSE
209                        FALSE
210                         TRUE
211                        FALSE
212                        FALSE
213                         TRUE
214                        FALSE
215                        FALSE
216                        FALSE
217                        FALSE
218                        FALSE
219                        FALSE
220                        FALSE
221                        FALSE
222                        FALSE
223                         TRUE
224                        FALSE
225                        FALSE
226                        FALSE
227                        FALSE
228                        FALSE
229                        FALSE
230                        FALSE
231                        FALSE
232                        FALSE
233                        FALSE
234                        FALSE
235                        FALSE
236                        FALSE
237                        FALSE
238                        FALSE
239                        FALSE
240                        FALSE
241                        FALSE
242                         TRUE
243                        FALSE
244                        FALSE
245                        FALSE
246                        FALSE
247                        FALSE
248                        FALSE
249                        FALSE
250                        FALSE
251                        FALSE
252                        FALSE
253                        FALSE
254                         TRUE
255                        FALSE
256                        FALSE
257                        FALSE
258                         TRUE
259                        FALSE