sendopk.blogg.se

Upload r package to github
Upload r package to github









So there is a need to weigh the benefits of maintaining the CRAN submission with having it on GitHub. However, uploading a package to CRAN and maintaining is a more time consuming process than simply uploading a package to GitHub, where changes can be made easily and quickly. I did not necessarily find this the case - that as long as you follow the package writing guidance- you should not be discouraged from uploading it to CRAN. I was somewhat apprehensive about submitting a package to CRAN – as the documentation and online guidance often paints this as a daunting task. I have uploaded one package onto CRAN: ITNr. Unless you set up pipes with usethis, more specially the use_pipe() function, avoid using pipes.Īlthough you can upload R packages onto GitHub, where others can download and install these packages using devtools, packages can also be uploaded to CRAN. There are number of very useful packages to use when creating an R package including devtools, usethis and roxygen2.Īnother point to make before writing an R package is about using %>% (pipes) in R package functions. They provide information on how to set up an R package, write documentation, along with how to write vignettes guides to accompany your package. The most useful guides on how to write an R package are: Furthermore, you can search for the help and guidance on these functions within R in the future. Having to write help documentations and examples is a very useful task, as you do not end up coming back to functions where there is little or no explanation of what they do. Writing a package provides the opportunity (and in some cases forces you) to improve your code so that it is more streamlined. It is much easier to share a package than a set of. It took some time – but it was completely worth it, as creating a package has a number of benefits:Īll related functions are in one place, and can be easily shared with colleagues. Therefore, I decided to take the next step and collect all these functions into an R package.

upload r package to github

I then had a number of functions related to cleaning and analysing trade data scattered across numerous. The advantages of using an R function were instantly obvious, the process of data cleaning now took moments. As I become more familiar with R – I did this in R and wrote a function I could use on any future data. I did this using excel (as at the time I was not fully familiar with R) and found it a very repetitive/laborious task. This involved cleaning the data, removing unnecessary actors (such as territories like “Other Asia not elsewhere classified”), applying a threshold, so the network only contained ties that were some percentage of world trade and finally convert this into a network file. Throughout my PhD I had to create networks from international trade data.











Upload r package to github