Simple flattened (sparse) arrays in R