add an option to specify R location in hmr