The code for the function can be downloaded here. This function takes an annotated phylogeny as an argument.
library(OutbreakTools)
library(ape)
source("make.node.age.df.R")
phy <- read.annotated.nexus("beast_ophidiiform_v04_02_phyloch_test.tre")
node.ages <- make.node.age.df(phy)
node.ages
## Lower95% Upper95% node
## 1 112.4742163 166.60677 54
## 12 71.8664074 123.74435 55
## 2 57.4122325 98.98174 56
## 3 47.4202788 83.33303 57
## 4 38.2002140 71.99557 58
## 7 21.7264045 48.56044 59
## 9 13.7674038 32.54472 60
## 10 9.9346375 22.96849 61
## 11 7.7180653 19.20702 62
## 13 5.2454633 15.32933 63
## 20 99.8554470 123.63707 64
## 21 93.4354424 115.48929 65
## 22 83.6843196 106.64131 66
## 23 76.0340142 92.13732 67
## 24 65.8898127 84.51596 68
## 25 55.9881565 62.18035 69
## 28 13.8066090 39.41201 70
## 31 56.9634262 75.16239 71
## 34 47.7156748 84.44428 72
## 37 83.5989293 104.08200 73
## 38 72.9441462 97.42948 74
## 40 60.1869392 86.94662 75
## 41 33.4628348 57.99894 76
## 44 39.4667208 69.33560 77
## 45 37.0099611 62.57525 78
## 46 31.7100237 56.39871 79
## 48 23.6888411 48.86645 80
## 51 26.2927603 50.78223 81
## 52 20.0471351 41.74582 82
## 54 15.0599999 39.91034 83
## 56 9.2249791 32.63858 84
## 59 16.6543009 42.46940 85
## 63 70.7313968 79.52990 86
## 64 27.0386482 48.49548 87
## 65 16.0024699 34.80740 88
## 66 12.2560475 30.33529 89
## 67 0.6470549 4.50941 90
## 72 15.6843546 34.45678 91
## 74 10.7669988 27.17710 92
## 76 5.0522886 18.30044 93
## 79 42.9548718 64.93858 94
## 81 38.5763716 59.59446 95
## 82 34.4823517 54.47268 96
## 83 31.5852950 52.38201 97
## 84 25.9559434 47.17883 98
## 85 8.8695740 26.35220 99
## 90 28.5898849 49.02411 100
## 91 24.7619804 47.18065 101
## 96 94.4211272 110.06939 102
## 98 41.8981341 87.47148 103
## 99 24.0384515 64.96807 104
## 102 2.8108064 12.31919 105