Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Quatargo exercise - modify existing package - Zoltan #8

Open
wants to merge 8 commits into
base: master
Choose a base branch
from

Conversation

zoltanszebenyi
Copy link

No description provided.

@codecov-io
Copy link

Codecov Report

❗ No coverage uploaded for pull request base (master@c4b35b1). Click here to learn what that means.
The diff coverage is 25%.

Impacted file tree graph

@@            Coverage Diff            @@
##             master       #8   +/-   ##
=========================================
  Coverage          ?   18.18%           
=========================================
  Files             ?        3           
  Lines             ?       11           
  Branches          ?        0           
=========================================
  Hits              ?        2           
  Misses            ?        9           
  Partials          ?        0
Impacted Files Coverage Δ
R/meanimpute.R 0% <ø> (ø)
R/windsorize.R 16.66% <20%> (ø)
R/transform_log.R 33.33% <33.33%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update c4b35b1...ed0e383. Read the comment docs.

Copy link
Member

@mannau mannau left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work!
Just found some minor issues regarding the function descriptions and edge cases in the windsorize function.

@@ -1 +1,2 @@
exportPattern("^[[:alpha:]]+")
importFrom("stats", "quantile")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why haven't you used the package roxygen2 to generate the NAMESPACE file?

@@ -1,4 +1,6 @@
#' Meanimputation
#' @param x A vector.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Longer description missing.

@@ -0,0 +1,16 @@
#' Transform_log
#'
#' Log transformation.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Description could be longer here.

#'
#' Do some windsorization.
#'
#' Winsorizing or winsorization is the transformation of statistics by limiting
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice description! Just missing how input parameter p influences the result

q <- quantile(x, p)
x[x >= q] <- q
if(all(is.na(x))) {stop("argument should not be a vector containing only NA-s or NULL-s")}
q_up <- quantile(x, 0.5 + p / 2 )
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Try to consider the following situations:

  • What happens if x contains some NA values?
  • What happens if x is an empty/NULL vector?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants