adapt R package