[R: New Features on beginr] Automatically generate a self-contained package

in #utopian-io6 years ago (edited)

Repository

<p dir="auto"><span><a href="https://github.com/pzhaonet/beginr" target="_blank" rel="nofollow noreferrer noopener" title="This link will take you away from hive.blog" class="external_link">https://github.com/pzhaonet/beginr <h3>Brief Intro and curriculum <p dir="auto">If you are an R beginner and you feel it difficult to learn, don’t worry. R can be fun and easy if you use the beginr package, which I developed for R beginners. beginr provides many useful functions, including some functions which help the beginners recall some commands in R, some wrapped plotting functions which can plot complex figures, some functions which can easily read and safely write data files, or process data frames. Furthermore, the source codes of beginr package were written on beginner’ level with the most commonly used functions. Any beginner can simply follow the source code so as to get ideas to write their own codes and even develop their own packages. <p dir="auto">A brief introduction can be found in one of my previous post: <ul> <li><a href="https://steemit.com/utopian-io/@dapeng/beginr-an-r-package-for-beginners-in-r-language" target="_blank" rel="nofollow noreferrer noopener" title="This link will take you away from hive.blog" class="external_link">beginr: an R package for beginners in R language <h3>New Features <p dir="auto"><em>Commit: <a href="https://github.com/pzhaonet/beginr/commit/d75e93050aa0bd8c49c2a1ef73322be4bc495bfa" target="_blank" rel="nofollow noreferrer noopener" title="This link will take you away from hive.blog" class="external_link"><code>packr() <p dir="auto">Most R beginners think that developing an R package is a mission impossible. It is not true. With the new function <code>packr() , users can create a user-defined useful R packages easily. They can specify in <code>packr()a group of packages (e.g. foo_1, foo_2, foo_x) which they often use and the new package name, say <code>foobar, then a new package called <code>foobar will be generated. <p dir="auto">When loading the <code>foobar function, the package group, i.e. foo_1, foo_2, and foo_x are loaded simultaneously. Moreover, a few functions are available in the <code>foobar package , which are well documented in the help. Briefly speaking, these functions can update the package group to the latest versions, check the conflicts with other loaded packages, list the dependencies, and so on. The user can share the <code>foobar package to friends or the community as well. <p dir="auto">The core codes of <code>packr() are written in <a href="https://github.com/pzhaonet/beginr/blob/master/R/packr.R" target="_blank" rel="nofollow noreferrer noopener" title="This link will take you away from hive.blog" class="external_link">R/packr.R, which calls multiple scripts and templates in <a href="https://github.com/pzhaonet/beginr/tree/master/inst/skeleton" target="_blank" rel="nofollow noreferrer noopener" title="This link will take you away from hive.blog" class="external_link">inst/skeleton. <h4>GitHub Account <p dir="auto"><span><a href="https://github.com/pzhaonet" target="_blank" rel="nofollow noreferrer noopener" title="This link will take you away from hive.blog" class="external_link">https://github.com/pzhaonet
Sort:  

Thank you for your contribution @dapeng !

<ol> <li>It looks to me <code>rmd_conflicts function and related ones are same as the <a href="https://github.com/pzhaonet/rmd/blob/master/R/conflicts.R" target="_blank" rel="noreferrer noopener" title="This link will take you away from hive.blog" class="external_link">one in your rmd contribution. Is it possible to <code>require the common module/functions so that you don't have code duplication over different projects. <li>The messages used in the <code>packr could be extracted so that you can internationalise those later. <p dir="auto">Your contribution has been evaluated according to <a href="https://join.utopian.io/guidelines" target="_blank" rel="noreferrer noopener" title="This link will take you away from hive.blog" class="external_link">Utopian policies and guidelines, as well as a predefined set of questions pertaining to the category. <p dir="auto">To view those questions and the relevant answers related to your post, <a href="https://review.utopian.io/result/3/2-3-3-1-2-3-1-" target="_blank" rel="noreferrer noopener" title="This link will take you away from hive.blog" class="external_link">click here. <hr /> <p dir="auto">Need help? Chat with us on <a href="https://discord.gg/uTyJkNm" target="_blank" rel="noreferrer noopener" title="This link will take you away from hive.blog" class="external_link">Discord. <p dir="auto"><a href="https://join.utopian.io/" target="_blank" rel="noreferrer noopener" title="This link will take you away from hive.blog" class="external_link">[utopian-moderator]

Thank you for your review, @justyy! Keep up the good work!

Technically, the idea of the packr() function came from the package 'rmd', which can load and install a group of R markdown packages. As it is quite useful to load user-defined multiple packages, I decided to pack the skeleton of 'rmd' into packr()so that everyone can create rmd-like packages. I would prefer to developing them independently because I will tailor 'rmd' for some specific use, while the current version is universal and sufficient for users to develop their own packages.

<p dir="auto">Thanks a lot for your kind comments.

Hi @dapeng!



Feel free to join our @steem-ua Discord serverYour post was upvoted by @steem-ua, new Steem dApp, using UserAuthority for algorithmic post curation! Your post is eligible for our upvote, thanks to our collaboration with @utopian-io!

I have been wanting to learn R, but I have never gotten around to it. Thanks for posting!

It is never too late to begin. Thanks for your msg.