# NOT RUN {
A <- c(1,2)
B <- c(3,4,5)
# Return the cartesian product [[1,3],[1,4],[1,5],[2,3],[2,4],[2,5]]
pCart( list( A, B) )
L1<-list( c(1,1), c(2))
L2<-list( c(5,5), c(7) )
# Return the Cartesian product [[1,1],[5,5]], [[1,1],[7]], [[2],[5,5]], [[2],[7]]
# assign the value to L3
L3<-pCart ( list(L1, L2) )
# Return the Cartesian product between L3 and [7]
# The result will be [[1,1],[5,5],[7]], [[1,1],[7],[7]], [[2],[5,5],[7]], [[2],[7],[7]]
pCart ( list(L3, c(7)) )
# }
Run the code above in your browser using DataLab