Thanks Mara. I think I worked it out.
I can append the <g> elements I need to the default <svg> container created by r2d3 in my js script with:
svg
.append("g")
.attr("class", "chart")
.append("g")
.attr("class", "bar")
Then the rest of the js code that was looking for <g> tags with class "bar" starts to work.
The long and painful journey of learning D3 has begun...