Skip to content

Commit

Permalink
minor good practice enhancements
Browse files Browse the repository at this point in the history
  • Loading branch information
MikeJaredS committed May 8, 2023
1 parent 4634f65 commit be400e3
Show file tree
Hide file tree
Showing 6 changed files with 32 additions and 23 deletions.
6 changes: 3 additions & 3 deletions R/hermite_estimator_bivar.R
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,7 @@ update_sequential_bivar_helper <- function(h_est_obj,x){
}
if (is.na(h_est_obj$exp_weight)){
h_est_obj$coeff_mat_bivar <- (h_est_obj$coeff_mat_bivar *
(h_est_obj$num_obs-1) + tcrossprod(h_x,h_y))/(h_est_obj$num_obs)
(h_est_obj$num_obs-1) + tcrossprod(h_x,h_y))/(h_est_obj$num_obs)
} else {
h_est_obj$coeff_mat_bivar<- h_est_obj$coeff_mat_bivar *
(1-h_est_obj$exp_weight) + tcrossprod(h_x,h_y)*h_est_obj$exp_weight
Expand Down Expand Up @@ -485,8 +485,8 @@ dens.hermite_estimator_bivar <- function(h_est_obj,x, clipped = FALSE,
#' Creates an object summarizing the bivariate PDF with associated generic
#' methods print and plot.
#'
#' The hermite_estimator_bivar object, x must be updated with observations prior
#' to the use of the method.
#' The hermite_estimator_bivar object, x must be updated with observations
#' prior to the use of the method.
#'
#' @param x A hermite_estimator_bivar object.
#' @param x_lower A numeric vector. This vector determines the lower limit of
Expand Down
11 changes: 5 additions & 6 deletions R/utils_general.R
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
#' on a hermite_estimator_univar object.
#'
#' Mirrors the print method of the stats::ecdf function
#'
#'
#' @param x A hcdf_univar object.
#' @param digits A numeric value. Number of digits to round to.
Expand Down Expand Up @@ -113,7 +112,7 @@ print.hcdf_bivar <- function (x,
#' @export
plot.hcdf_bivar <- function (x, main="Hermite CDF",xlab = "X", ylab="Y",...)
{
z = matrix(x$cum_prob_vals,byrow = FALSE,nrow=length(x$x_vals_1))
z <- matrix(x$cum_prob_vals,byrow = FALSE,nrow=length(x$x_vals_1))
filled.contour(x = x$x_vals_1,y = x$x_vals_2, z= z,
color.palette = function(n) hcl.colors(n, "Oslo", rev = TRUE),
main=main,xlab=xlab,ylab=ylab)
Expand Down Expand Up @@ -231,7 +230,7 @@ print.hdensity_bivar <- function (x,
plot.hdensity_bivar <- function(x, main="Hermite PDF",xlab = "X", ylab = "Y",
...)
{
z = matrix(x$density_vals,byrow = FALSE,nrow=length(x$x_vals_1))
z <- matrix(x$density_vals,byrow = FALSE,nrow=length(x$x_vals_1))
cols <- hcl.colors(10, "Oslo")
filled.contour(x = x$x_vals_1,y = x$x_vals_2, z= z,
color.palette = function(n) hcl.colors(n, "Oslo", rev = TRUE),
Expand All @@ -241,9 +240,9 @@ plot.hdensity_bivar <- function(x, main="Hermite PDF",xlab = "X", ylab = "Y",
#' A wrapper around the stats::cor function adding two additional methods,
#' namely method = "hermite.spearman" and method = "hermite.kendall" (can be
#' abbreviated). The input parameters and output value semantics closely match
#' the stats::cor method for easy interchange. If neither the "hermite.spearman"
#' nor the "hermite.kendall" method is selected, then this function will call
#' stats::cor with the arguments provided.
#' the stats::cor method for easy interchange. If neither the
#' "hermite.spearman" nor the "hermite.kendall" method is selected, then this
#' function will call stats::cor with the arguments provided.
#'
#' @param x a numeric vector, matrix or data frame.
#' @param y NULL (default) or a vector, matrix or data frame with
Expand Down
20 changes: 15 additions & 5 deletions cran-comments.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,24 +23,34 @@ plot and summary generics.
## Test environments
* local R installation, Windows 10, R 4.3.0
* Ubuntu Linux 20.04.1 LTS, R-release, GCC (r-hub)
* Debian Linux, R-devel, GCC ASAN/UBSAN (r-hub)
* Debian Linux, R-release, GCC (r-hub)
* Fedora Linux, R-devel, clang, gfortran (r-hub)
* macOS 10.13.6 High Sierra, R-release, brew
* macOS 10.13.6 High Sierra, R-release, brew (r-hub)
* Windows Server 2022, R-devel, 64 bit (r-hub)
* win-builder (devel, release. oldrel)

## R CMD check results

There was 1 NOTE across environments:
There was 1 NOTE across all environments:

GNU make is a SystemRequirements.

* This appears to be related to using RcppParallel and does not seem
problematic. GNU make has been added to SystemRequirements in the Description
file.

* In addition, on Ubuntu 20.04.1 LTS, the package
appears to be slightly larger than 5MB, around 5.9 MB. This does not
* In addition, on Debian and Ubuntu Linux, the package
appears to be slightly larger than 5MB, around 5.2- 6 MB. This does not
appear to occur on any of the other environments however (i.e. Fedora Linux,
Windows, MacOS)

* Finally, there is the following note on Ubuntu and Fedora Linux:

* checking HTML version of manual ... NOTE
Skipping checking HTML validation: no command 'tidy' found
Skipping checking math rendering: package 'V8' unavailable

This seems build system specific and not directly tied to the package.

* There is also a PREPERROR for Debian Linux, R-devel, GCC ASAN/UBSAN on rhub
- we believe this is an issue on the build server and not package specific.
12 changes: 6 additions & 6 deletions man/cor.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions man/density.hermite_estimator_bivar.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion tests/testthat/test_utilities_general.R
Original file line number Diff line number Diff line change
Expand Up @@ -457,7 +457,7 @@ test_that("quantile, median and IQR generics work correctly", {
hermite_est <- hermite_estimator(observations = test_observations,
standardize = TRUE)
quantiles_est <- quantile(hermite_est)
target_quantiles = c(-14.64905596,
target_quantiles <- c(-14.64905596,
-1.57302308,
0.04009478,
1.01244707,
Expand Down

0 comments on commit be400e3

Please sign in to comment.