Running examples in ‘relations-Ex.R’ failed
The error most likely occurred in:

> ### Name: algebra
> ### Title: Relational Algebra
> ### Aliases: algebra relation_union relation_intersection relation_symdiff
> ###   relation_complement relation_cartesian relation_projection
> ###   relation_selection relation_division relation_join relation_semijoin
> ###   relation_antijoin relation_remainder %><% %=><% %><=% %=><=% %|><%
> ###   %><|% %|><|% %|>% %<|% %U%
> ### Keywords: math
> 
> ### ** Examples
> 
> ## projection
> Person <-
+     data.frame(Name = c("Harry", "Sally", "George", "Helena", "Peter"),
+                Age = c(34, 28, 29, 54, 34),
+                Weight = c(80, 64, 70, 54, 80),
+                stringsAsFactors = FALSE)
> Person <- as.relation(Person)
> relation_table(Person)
 Name   Age Weight
 Helena 54  54    
 Sally  28  64    
 George 29  70    
 Harry  34  80    
 Peter  34  80    
> relation_table(relation_projection(Person, c("Age", "Weight")))
 Age Weight
 54  54    
 28  64    
 29  70    
 34  80    
> 
> ## selection
> relation_table(R1 <- relation_selection(Person, Age < 29))
 Name  Age Weight
 Sally 28  64    
> relation_table(R2 <- relation_selection(Person, Age >= 34))
 Name   Age Weight
 Helena 54  54    
 Harry  34  80    
 Peter  34  80    
> relation_table(R3 <- relation_selection(Person, Age == Weight))
 Name   Age Weight
 Helena 54  54    
> 
> ## union
> relation_table(R1 %U% R2)
 Name   Age Weight
 Helena 54  54    
 Sally  28  64    
 Harry  34  80    
 Peter  34  80    
> 
> ## works only for the same domains:
> relation_table(R2 | R3)
 Name   Age Weight
 Helena 54  54    
 Harry  34  80    
 Peter  34  80    
> 
> ## complement
> relation_table(Person - R2)
 Name   Age Weight
 Sally  28  64    
 George 29  70    
> 
> ## intersection
> relation_table(relation_intersection(R2, R3))
 Name   Age Weight
 Helena 54  54    
> 
> ## works only for the same domains:
> relation_table(R2 & R3)
 Name   Age Weight
 Helena 54  54    
> 
> ## symmetric difference
> relation_table(relation_symdiff(R2, R3))
 Name  Age Weight
 Harry 34  80    
 Peter 34  80    
> 
> ## Cartesian product
> Employee <-
+     data.frame(Name =
+                c("Harry", "Sally", "George", "Harriet", "John"),
+                EmpId = c(3415, 2241, 3401, 2202, 3999),
+                DeptName =
+                c("Finance", "Sales", "Finance", "Sales", "N.N."),
+ 	       stringsAsFactors = FALSE)
> Employee <- as.relation(Employee)
> relation_table(Employee)
 Name    EmpId DeptName
 George  3401  Finance 
 Harry   3415  Finance 
 John    3999  N.N.    
 Harriet 2202  Sales   
 Sally   2241  Sales   
> Dept <- data.frame(DeptName = c("Finance", "Sales", "Production"),
+                    Manager = c("George", "Harriet", "Charles"),
+                    stringsAsFactors = FALSE)
> Dept <- as.relation(Dept)
> relation_table(Dept)
 DeptName   Manager
 Production Charles
 Finance    George 
 Sales      Harriet
> 
> relation_table(Employee %><% Dept)
 Name    EmpId DeptName DeptName   Manager
 George  3401  Finance  Production Charles
 Harry   3415  Finance  Production Charles
 John    3999  N.N.     Production Charles
 Harriet 2202  Sales    Production Charles
 Sally   2241  Sales    Production Charles
 George  3401  Finance  Finance    George 
 Harry   3415  Finance  Finance    George 
 John    3999  N.N.     Finance    George 
 Harriet 2202  Sales    Finance    George 
 Sally   2241  Sales    Finance    George 
 George  3401  Finance  Sales      Harriet
 Harry   3415  Finance  Sales      Harriet
 John    3999  N.N.     Sales      Harriet
 Harriet 2202  Sales    Sales      Harriet
 Sally   2241  Sales    Sales      Harriet
> 
> ## Natural join
> relation_table(Employee %|><|% Dept)
 Name    EmpId DeptName Manager
 George  3401  Finance  George 
 Harry   3415  Finance  George 
 Harriet 2202  Sales    Harriet
 Sally   2241  Sales    Harriet
> 
> ## left (outer) join
> relation_table(Employee %=><% Dept)
 Name    EmpId DeptName Manager
 George  3401  Finance  George 
 Harry   3415  Finance  George 
 Harriet 2202  Sales    Harriet
 Sally   2241  Sales    Harriet
 John    3999  N.N.     NA     
> 
> ## right (outer) join
> relation_table(Employee %><=% Dept)
 Name    EmpId DeptName   Manager
 NA        NA  Production Charles
 George  3401  Finance    George 
 Harry   3415  Finance    George 
 Harriet 2202  Sales      Harriet
 Sally   2241  Sales      Harriet
> 
> ## full outer join
> relation_table(Employee %=><=% Dept)
 Name    EmpId DeptName   Manager
 NA        NA  Production Charles
 George  3401  Finance    George 
 Harry   3415  Finance    George 
 Harriet 2202  Sales      Harriet
 Sally   2241  Sales      Harriet
 John    3999  N.N.       NA     
> 
> ## antijoin
> relation_table(Employee %|>% Dept)
Error in c(0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 1L, 0L, 0L, 0L, 0L, 0L, 1L,  : 
  subscript out of bounds
Calls: relation_table ... %|>% -> Ops.relation -> relation_complement -> do.call
Execution halted