fix C++ intrinsic version of Hn function
add type argument to R implementation
roxygenize extended example