Each R package includes a number of functions and/or datasets with the objective of making it a tool in its own right. It allows you to share with people resources that are not available in the basic R features and that you have developed to meet your needs.
As an example, at SMCS, we have made a package containing functions that estimate a survival model (when the dependent variable is time to an event, in the presence of right censoring) when it is known that some individuals will never experience the event of interest and some continuous explanatory variables in the model are measured with error.
Please note: the Write and publish your work in an R-package training is offered on a regular basis by the SMCS and aims, as its name suggests, to teach participants how to create and publish R packages.