change into R package