What is currently the most elegant way to get a array with column names containing all combinations of given elements? Some closest analogue of the function expand.grid() from R. All the discussions I've met on this issue have been about either a slightly different formulation of the problem, or were conducted in the days of very old versions of Julia. The most rational solution that I found at the moment looks like this:
using DataFrames
xy = [[x,y] for x in 0:0.25:1 for y in 0:0.25:1]
xy_array = permutedims(reshape(hcat(xy...), (length(xy[1]), length(xy))))
df = DataFrame(x = xy_array[:,1], y = xy_array[:,2])
A similar expression in R can be written much more compactly:
xy_comb <- expand.grid(x=seq(0, 1, 0.25), y=seq(0, 1, 0.25))
Is there any more concise form to writing a same expression in Julia?