Site icon R-bloggers

“sinkr” – a collection of functions featured on “me nugget”

[This article was first published on me nugget, and kindly contributed to R-bloggers]. (You can report issue about the content on this page here)
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.
The R package sinkr (version 1.0) has now been released:  https://github.com/menugget/sinkr

I have finally gotten around to learning how to create an R package and decided to start by bundling functions that I have featured on the blog. Thanks to the R Studio team for making this so easy (in combination with the R packages roxygen2 and devtools). In addition to the great tips on the R Studio website,  I found the following Youtube videos helpful along the way:
Being new to the world of R packages (and due to the eclectic nature of the functions in sinkr), I’m not confident to upload this to CRAN. But, one can easily install the package using devtools and the following code (see https://github.com/hadley/devtools for OS-specific package updating tips):

library(devtools)

install_github(“sinkr”, “menugget”)

For those using functions that were featured on this site in the past, the present versions may differ slightly, especially in the case of function names. For example, function names like plot.stacked were getting associated with the general plot function during the package build and thus “.” characters have been removed from all function names (e.g. plotStacked).

sinkr functions include:

I can recommend package creation to anyone who wants greater control and clearer documentation of functions. I also used to do a lot of numbering of R scripts to keep track of versions (e.g. “plotstacked.03.R”). R studio combined with GitHub has been a real revelation to me in this regard (thanks to Tal Galili for the final nudge!: http://datascience.la/a-conversation-with-tal-galili-at-user-2014/).

I hope that future function examples will be easier to reproduce through simple loading of the sinkr package.

To leave a comment for the author, please follow the link and comment on their blog: me nugget.

R-bloggers.com offers daily e-mail updates about R news and tutorials about learning R and many other topics. Click here if you're looking to post or find an R/data-science job.
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.