# Generate a vector of item sizes
x <- sample(100, 1000, replace = TRUE)
# Pack those items into bins of capacity 130
bins <- bin_pack_ffd(x, cap = 130)
# Number of bins needed to pack the items
print(length(unique(bins)))
Run the code above in your browser using DataLab