Closed shaorray closed 4 years ago
Hi @shaorray ! Thanks for contributing to the repo! :) I have realised that in documenting the package I have not written or linked any style guide, as I was not sure how much contribution I would get. But since you are including code, it is important that we agree on certain style, so all the code within the package looks the same and we don't confuse users (and ourselves).
I am aware that for R there is no global agreement on coding standards, but tidyverse coding standard seems to be one of the most widely accepted ones, and it's the one I am following.
So I will make some comments on your pull request according to this, mostly. I will also include this info in the README.
Ok, I replaced the function name, and camel naming style can leave for methods.
I don't know how to compile the package to include the new file, roxygen2 doesn't add the new namespace to the package.
In general you should have the same style everywhere in your code, and even if it feels as nitpicking, it helps in the long run, and also cooperating with others. These are just common good programming practices.
Almost every respectable coding project that involves more than one person (and sometimes even those) has a style guide that developers follow. Some of the initial decisions are a matter of taste, but the code gains in quality and readability just by being consistent, it is definitely a bad practice to have mixed naming conventions within the same code.
You can also use styler
to format code, it seems to be working nicely.
About the compiling: If you are using R studio and open the R project attached to the package: It is my understanding that R studio will update the NAMESPACE
file when you document or devtools::build()
, I think. You should see some line that says Writing NAMESPACE
in the process, and then if you look at the file you should see in there lines that contain export(your_function)
. But do not edit this by hand, it should be generated by Roxygen2.
At this moment if vignettes are built it takes a bit long because there is some bw
file that is processed. I'm working in including a small toy dataset that does not stall the build.
I have cloned your branch and it did work for me. So what I did:
elsasserlib.Rproj
with R studio.Md
documents needed so documentation shows when you hit ?quantile_norm
. Then you should be able to run it.
To build, you can call devtools::build()
or Command + Shift + B. devtools::check()
is also good to see if everything is ok: http://r-pkgs.had.co.nz/check.html
Three functions often use in gene count table normalization, quantile normalization is very common in ChIP sample, size factor and median ratio are for RNA expression.