Data is available here. Have a look to it. Note the wide (untidy) format: each group is provided in a specific line, each subgroup in a specific column.
The trick here is to build two X scales. The first is called x and is for groups. It is used to build the axis. The second is called xSubgroup and allows to adjust the position for each subgroup in the group.