This is by far from elegant but works:
save the output of
dendrapply(my_dend, function(n) utils::str(attributes(n)))
to a file, and edit that file:
out.fn <- "dendrogram.output"
capture.output(dendrapply(my_dend, function(n) utils::str(attributes(n))),file=out.fn)
system(paste0("sed -i '/List of/d' ",out.fn))
system(paste0("sed -i '/\\[\\[/d' ",out.fn))
system(paste0("sed -i '/NULL/d' ",out.fn))
system(paste0("sed -i '/^$/d' ",out.fn))
system(paste0("sed -i '/class/d' ",out.fn))
system(paste0("sed -i '/midpoint/d' ",out.fn))
system(paste0("sed -i '/leaf/d' ",out.fn))
system(paste0("sed -i '/label/d' ",out.fn))
system(paste0("sed -i '/members/d' ",out.fn))
system(paste0("sed -i 's/ \\$ //g' ",out.fn))
system(paste0("perl -i -pe 's/height\\s+:\\s+num\\s+//g' ",out.fn))
my_dend.df <- dplyr::filter(read.table(out.fn,header=F,sep=",",stringsAsFactors=F,col.names="depth"),depth != 0)
> my_dend.df
depth
1 6.50
2 5.51
3 3.75
4 2.20
5 2.89
6 4.18
7 2.84
8 4.10
9 2.66