The problem you have is because metagene will try to split all the regions into 100 bins by defaults to make sure all the regions have the same size. In your data, some regions are probably smaller than 100 nucleotides, which is why there is the error message you saw.
You have two options to solve this problem:
1. You can resize your regions before starting the metagene analysis. For example, if you want to resize all your original regions to 200 nucleotides:
resized_regions <- resize(original_regions, 200, fix = "center")
2. You can reduce the number of bins. For instance, if you saved the metagene object in a variable named mg:
mg$produce_matrices(bin_count = 50) mg$plot()
With option 1, each bin will always represent the same number of nucleotides (i.e.: if your regions all have a size of 200 nucleotides and the bin_size is 100, each bin will contain the average coverage of 2 nucleotides). With option 2, if the regions have different sizes, the number of nucleotide of each bin will be different for each region.
Here is a visual representation on how the bins are produced:
Thank you for your interest in metagene!