added: dimensionality adjustment, updated R wrapper and tests