Open yidie opened 6 years ago
Hi! @yidie I am really happy to review your homework, and I think you did a great job! I installed your package, and it works well.
stopifont
to check the user’s input, that makes your function more robust. Also, in your testthat.R file, it’s really nice that you wrote three different types of unit tests for each functions: expect_false
, expect_true
, expect_error
. So, I think you have achieved most of the requirements of the homework.
Besides, there are also some things I think you need to improve. Overall, I think you did a really nice job in this homework and I am looking forward to see more features added to your package!
Menglin Zhou
Hi @yidie , Great work! Here's my review for homework 09:
Coding style: Clear and organized, easy to follow along! I would suggest adding comments to explain your code
Coding strategy: Simple and efficient, logical flow of code
Presentation - graphs:
Great job with fbarplot()
and incorporating various ggplot2 features
Achievement, mastery, cleverness, creativity: Excellent application of tools and techniques learned from the course and beyond. Great job completing the chosen tasks thoroughly! I like that you chose a different package from what was done in class and challenged yourself
Ease of access for instructor, compliance with course conventions for submitted work: + Easy access, code runs!
Your NAMESPACE is missing your functions!
Your README file is detailed and contains a good amount of examples. You wrote different types of unit tests which was great to see!
Overall great work! 👍
Thanks, Amanda
Hi @yidie, here are some comments about your hw09:
Able to install properly: Yes
At least one new function: Yes
Used assertions to check function input: Yes
Documented exported functions: Yes
Includes three unit tests for each function: Yes
Passes check
: Yes
README and vignette: Yes
Reflections included: Yes
Your grade will be emailed to you at a later date.
My package is in a different repo. You can find it here.
Process Report:
Jenny's tutorial is very helpful. It is very cool that now I know how to build an R package from scratch.
I encountered some issue when writing
fbarplot()
function. I make use ofggplot
in this function., which gives me a note message "no visible binding for global variable" when I run check. I searched online and found this post, which resolves my issue. After I changedggplot2::aes(x=x,y=n)
toggplot2::aes_(x=~x,y=~n)
, it works. This might be helpful if you, by any chance, need to useggplot
for your package in the future and run into the same problem.At first, I am not sure how to write tests for
fbarplot()
function because it returns a plot. This post is very helpful. However, a package calledproto
is used in order to access sub-components of ggplot2 object. I have added this package toimports
section inDESCRIPTION
. And I calledlibrary(proto)
intest_fbarplot.R
because I am not sure how to use something likeproto::
in this case since I am not really using any function from that package.