# NOT RUN {
hd <- HistDat(vals = 1:3, counts = c(1, 2, 1))
hd_2 = c(1, 1, hd)
hd@counts # returns 1 2 1
hd_2@counts # returns 3 2 1, as the first value now has 2 more counts
hd_2@vals # returns 1 2 3 (this is unchanged)
# }
Run the code above in your browser using DataLab