The weighted mean function.
The weighted mean for orientations is the nearest SO(3) matrix to the entrywise weighted mean of the rotmatrix-class matrices.
rotmatrix-class
stats::weighted.mean