Open rainerlempert opened 7 years ago
Your README is sufficiently descriptive, if a little brief. It gets the job done.
Just a small tip: in R markdown files, to hide an unwanted output you can use {r, eval = FALSE}
in the code header.
Installing with devtools::install_github("rainerlempert/Lempert_Rainer_hw09")
was successful, thats the first step!
Using ?powers
brought up the package documentation, which is empty. You should have added package documentation using the same process you did for the individual function documentation but instead writing NULL
for the "function name".
I checked out the function documentation using ?square
, its the same as the one we all made in class together.
The function seems to work as intended, but without additional features.
Using this function with a character vector gives a nice descriptive error message, but the error message for other unintended objects (such as a data frame of characters) is still cryptic. It is better to set up your function so that it checks that your input is numeric (or logical) and outputs an error message otherwise. Here you have set it to check explicitly for character inputs and throw an error if found.
I think you should have made better documentation here. I had never heard of the boxcox transform before this class, and your function documentation doesn't help me understand what it is for. When should I use a boxcox transform? What are the limitations? etc.
One of the examples in your documentation for this function boxcox(-5,0)
throws an error when actually executed.
In the function code you use if (lambda!=0)
, this could simply be replaced by else
.
You have to build your Vignettes with devtools::build_vignettes()
for them to be accessable to the end user outside of github.
Provides examples of all your functions, though it's pretty short.
Overall: You have completed most of the tasks required for this assignment, but there are missing parts.
Cheers,
Hayden
Hello, @rainerlempert . Here are some comments on your hw09. Hope it helps!
Your README
and vignettes
have all the required information to understand the package. More explanations would help users understand the package and the functions.
I don't know why but ?powers
, ?square
, ?cube
, ?pow
, ?boxcox
did not work for me.
It would be a little bit better if you could describe more about the package in powers-package.r
.
You have an internal function, pow()
. When functions are more complicated and have some repeating works, internal functions would be more useful to avoid redundancy.
square()
, cube()
, boxcox()
if
statements for a validity check of function input. They work nicely! When the input is a string, the functions stop and warn that these functions require a vector or number. boxcox()
to get a positive input. plot_it
or na.omit
.Unit tests for every function might check missing parts and reduce warnings or errors.
It would be good if you could try to import some other packages such as ggplot2
or stringr
.
Overall, I think you understand the essential things to make your own package! It would be better if you could experiment a little bit more. You did a good job!
I just created the public repository, so you can download the package!