Skip to content

Conversation

@LarisaYanceva
Copy link

All issues are fixed.

@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 100%.

Impacted file tree graph

@@            Coverage Diff            @@
##             master      #13   +/-   ##
=========================================
  Coverage          ?   90.47%           
=========================================
  Files             ?        3           
  Lines             ?       21           
  Branches          ?        0           
=========================================
  Hits              ?       19           
  Misses            ?        2           
  Partials          ?        0
Impacted Files Coverage Δ
R/meanimpute.R 0% <ø> (ø)
R/transform_log.R 100% <100%> (ø)
R/windsorize.R 100% <100%> (ø)

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...5c2ce83. 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 a few minor issues in the code.

@@ -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.

It does not seem that the file has been created with roxygen2. Why?

@@ -1,4 +1,5 @@
#' 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.

Please include a description of the function here.

@@ -0,0 +1,19 @@
#' transform_log
#' Transform numerical values into their log values
Copy link
Member

Choose a reason for hiding this comment

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

You should include an empty roxygen line between header and description.

@@ -0,0 +1,19 @@
#' transform_log
#' Transform numerical values into their log values
#' @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.

Parameter description could be more specific here, e.g. indicating the data type.

#'
transform_log <- function(x) {
if (!is.numeric(x)) {
warning("transform_log: Expecting numeric argument")
Copy link
Member

Choose a reason for hiding this comment

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

You should stop here instead of indicating a warning. Implicit data type conversions can always lead to strange results.

if (!is.numeric(x)) {
warning("transform_log: Expecting numeric argument")
}
x_badval <- is.na(suppressWarnings(as.numeric(x)))
Copy link
Member

Choose a reason for hiding this comment

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

No implicit conversion should be done here, see previous comment.

if (p < 0 || p > 1) {
stop("p invalid percentale. Expected values from 0 to 1")
}
q_lower <- quantile(x, (1-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.

What happens if vector x contains some NA values here?

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