Skip to content

Commit be400e3

Browse files
committed
minor good practice enhancements
1 parent 4634f65 commit be400e3

File tree

6 files changed

+32
-23
lines changed

6 files changed

+32
-23
lines changed

R/hermite_estimator_bivar.R

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -330,7 +330,7 @@ update_sequential_bivar_helper <- function(h_est_obj,x){
330330
}
331331
if (is.na(h_est_obj$exp_weight)){
332332
h_est_obj$coeff_mat_bivar <- (h_est_obj$coeff_mat_bivar *
333-
(h_est_obj$num_obs-1) + tcrossprod(h_x,h_y))/(h_est_obj$num_obs)
333+
(h_est_obj$num_obs-1) + tcrossprod(h_x,h_y))/(h_est_obj$num_obs)
334334
} else {
335335
h_est_obj$coeff_mat_bivar<- h_est_obj$coeff_mat_bivar *
336336
(1-h_est_obj$exp_weight) + tcrossprod(h_x,h_y)*h_est_obj$exp_weight
@@ -485,8 +485,8 @@ dens.hermite_estimator_bivar <- function(h_est_obj,x, clipped = FALSE,
485485
#' Creates an object summarizing the bivariate PDF with associated generic
486486
#' methods print and plot.
487487
#'
488-
#' The hermite_estimator_bivar object, x must be updated with observations prior
489-
#' to the use of the method.
488+
#' The hermite_estimator_bivar object, x must be updated with observations
489+
#' prior to the use of the method.
490490
#'
491491
#' @param x A hermite_estimator_bivar object.
492492
#' @param x_lower A numeric vector. This vector determines the lower limit of

R/utils_general.R

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
#' on a hermite_estimator_univar object.
33
#'
44
#' Mirrors the print method of the stats::ecdf function
5-
#'
65
#'
76
#' @param x A hcdf_univar object.
87
#' @param digits A numeric value. Number of digits to round to.
@@ -113,7 +112,7 @@ print.hcdf_bivar <- function (x,
113112
#' @export
114113
plot.hcdf_bivar <- function (x, main="Hermite CDF",xlab = "X", ylab="Y",...)
115114
{
116-
z = matrix(x$cum_prob_vals,byrow = FALSE,nrow=length(x$x_vals_1))
115+
z <- matrix(x$cum_prob_vals,byrow = FALSE,nrow=length(x$x_vals_1))
117116
filled.contour(x = x$x_vals_1,y = x$x_vals_2, z= z,
118117
color.palette = function(n) hcl.colors(n, "Oslo", rev = TRUE),
119118
main=main,xlab=xlab,ylab=ylab)
@@ -231,7 +230,7 @@ print.hdensity_bivar <- function (x,
231230
plot.hdensity_bivar <- function(x, main="Hermite PDF",xlab = "X", ylab = "Y",
232231
...)
233232
{
234-
z = matrix(x$density_vals,byrow = FALSE,nrow=length(x$x_vals_1))
233+
z <- matrix(x$density_vals,byrow = FALSE,nrow=length(x$x_vals_1))
235234
cols <- hcl.colors(10, "Oslo")
236235
filled.contour(x = x$x_vals_1,y = x$x_vals_2, z= z,
237236
color.palette = function(n) hcl.colors(n, "Oslo", rev = TRUE),
@@ -241,9 +240,9 @@ plot.hdensity_bivar <- function(x, main="Hermite PDF",xlab = "X", ylab = "Y",
241240
#' A wrapper around the stats::cor function adding two additional methods,
242241
#' namely method = "hermite.spearman" and method = "hermite.kendall" (can be
243242
#' abbreviated). The input parameters and output value semantics closely match
244-
#' the stats::cor method for easy interchange. If neither the "hermite.spearman"
245-
#' nor the "hermite.kendall" method is selected, then this function will call
246-
#' stats::cor with the arguments provided.
243+
#' the stats::cor method for easy interchange. If neither the
244+
#' "hermite.spearman" nor the "hermite.kendall" method is selected, then this
245+
#' function will call stats::cor with the arguments provided.
247246
#'
248247
#' @param x a numeric vector, matrix or data frame.
249248
#' @param y NULL (default) or a vector, matrix or data frame with

cran-comments.md

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,24 +23,34 @@ plot and summary generics.
2323
## Test environments
2424
* local R installation, Windows 10, R 4.3.0
2525
* Ubuntu Linux 20.04.1 LTS, R-release, GCC (r-hub)
26-
* Debian Linux, R-devel, GCC ASAN/UBSAN (r-hub)
26+
* Debian Linux, R-release, GCC (r-hub)
2727
* Fedora Linux, R-devel, clang, gfortran (r-hub)
28-
* macOS 10.13.6 High Sierra, R-release, brew
28+
* macOS 10.13.6 High Sierra, R-release, brew (r-hub)
2929
* Windows Server 2022, R-devel, 64 bit (r-hub)
3030
* win-builder (devel, release. oldrel)
3131

3232
## R CMD check results
3333

34-
There was 1 NOTE across environments:
34+
There was 1 NOTE across all environments:
3535

3636
GNU make is a SystemRequirements.
3737

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

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

47+
* Finally, there is the following note on Ubuntu and Fedora Linux:
48+
49+
* checking HTML version of manual ... NOTE
50+
Skipping checking HTML validation: no command 'tidy' found
51+
Skipping checking math rendering: package 'V8' unavailable
52+
53+
This seems build system specific and not directly tied to the package.
54+
55+
* There is also a PREPERROR for Debian Linux, R-devel, GCC ASAN/UBSAN on rhub
56+
- we believe this is an issue on the build server and not package specific.

man/cor.Rd

Lines changed: 6 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/density.hermite_estimator_bivar.Rd

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

tests/testthat/test_utilities_general.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -457,7 +457,7 @@ test_that("quantile, median and IQR generics work correctly", {
457457
hermite_est <- hermite_estimator(observations = test_observations,
458458
standardize = TRUE)
459459
quantiles_est <- quantile(hermite_est)
460-
target_quantiles = c(-14.64905596,
460+
target_quantiles <- c(-14.64905596,
461461
-1.57302308,
462462
0.04009478,
463463
1.01244707,

0 commit comments

Comments
 (0)