In Julia, it’s ideal to define your own types — you simply make fields in the type to hold attributes. In R, the good thing about storing things as attributes is that they do not affect how the type sends - for example, adding metadata to a vector does not cause it to stop behaving like a vector. In julia, this approach is a bit more complicated - you will need to define an interface AbstractVector
for your type https://docs.julialang.org/en/latest/manual/interfaces/#man-interface-array-1 to have it behave like a vector.
, , . R . - Julia , :
function ex()
res = rand(5)
met = "uniformly distributed random numbers"
res, met
end
result, metadata = ex()
, , R.