@@ -167,7 +167,7 @@
Loading
167 167
  check_length(x, result, "full_vec")
168 168
169 169
  cat(crayon::italic(
170 -
    crayon::cyan(x$vec_id, "full_vec result = ")),
170 +
    crayon::cyan(x$vec_id, ": full_vec result = ")),
171 171
    display_parameter(result), "\n", sep = "")
172 172
173 173
  result
@@ -270,16 +270,31 @@
Loading
270 270
}
271 271
272 272
273 -
diagnostic_min <- function(x) {
273 +
diagnostic_min <- function(x, na_rm) {
274 +
  result <- run_user_method2(user_method_min, x, na_rm)
275 +
276 +
  check_type(x, result, "min")
277 +
  check_fixed_length(result, "min", 1)
278 +
274 279
  cat(crayon::italic(
275 -
    crayon::cyan(x[[1]], ": min: result = ")),
276 -
    display_parameter(x[[2]]), "\n", sep = "")
280 +
    crayon::cyan(x$vec_id, ": min : result = ")),
281 +
    display_parameter(result), "\n", sep = "")
282 +
283 +
  result
277 284
}
278 285
279 286
280 -
diagnostic_max <- function(x) {
281 -
  cat(crayon::italic(crayon::cyan(" max: result = ")),
282 -
      display_parameter(x), "\n", sep = "")
287 +
diagnostic_max <- function(x, na_rm) {
288 +
  result <- run_user_method2(user_method_max, x, na_rm)
289 +
290 +
  check_type(x, result, "max")
291 +
  check_fixed_length(result, "max", 1)
292 +
293 +
  cat(crayon::italic(
294 +
    crayon::cyan(x$vec_id, ": max : result = ")),
295 +
    display_parameter(result), "\n", sep = "")
296 +
297 +
  result
283 298
}
284 299
285 300

@@ -241,19 +241,18 @@
Loading
241 241
  // calling environment
242 242
  SEXP calling_env = PROTECT(LAZYVEC_PACKAGE_ENV(x));
243 243
  
244 -
  // length listener method
244 +
  // min listener method
245 245
  SEXP min_listener = PROTECT(VECTOR_ELT(LAZYVEC_DIAGNOSTICS(x), LAZYVEC_METHOD_MIN));
246 246
  
247 247
  // na_rm argument
248 -
  SEXP na_rm_arg = PROTECT(Rf_ScalarInteger(na_rm));
248 +
  SEXP na_rm_arg = PROTECT(Rf_ScalarLogical(na_rm));
249 249
  
250 -
  // ALTREP override
251 -
  // should return a length 1 vector containing the element
252 -
  SEXP custom_element = PROTECT(call_dual_r_interface(min_listener, user_data, na_rm_arg, calling_env));
250 +
  // returns SEXP (integer or double)
251 +
  SEXP custom_min = PROTECT(call_dual_r_interface(min_listener, user_data, na_rm_arg, calling_env));
253 252
  
254 -
  UNPROTECT(5);  // last PROTECT could be removed
253 +
  UNPROTECT(5);
255 254
  
256 -
  return custom_element;
255 +
  return custom_min;
257 256
}
258 257
259 258
@@ -265,19 +264,18 @@
Loading
265 264
  // calling environment
266 265
  SEXP calling_env = PROTECT(LAZYVEC_PACKAGE_ENV(x));
267 266
  
268 -
  // length listener method
267 +
  // max listener method
269 268
  SEXP max_listener = PROTECT(VECTOR_ELT(LAZYVEC_DIAGNOSTICS(x), LAZYVEC_METHOD_MAX));
270 269
  
271 270
  // na_rm argument
272 -
  SEXP na_rm_arg = PROTECT(Rf_ScalarInteger(na_rm));
271 +
  SEXP na_rm_arg = PROTECT(Rf_ScalarLogical(na_rm));
273 272
  
274 -
  // ALTREP override
275 -
  // should return a length 1 vector containing the element
276 -
  SEXP custom_element = PROTECT(call_dual_r_interface(max_listener, user_data, na_rm_arg, calling_env));
273 +
  // returns SEXP (integer or double)
274 +
  SEXP custom_max = PROTECT(call_dual_r_interface(max_listener, user_data, na_rm_arg, calling_env));
277 275
  
278 -
  UNPROTECT(5);  // last PROTECT could be removed
276 +
  UNPROTECT(5);
279 277
  
280 -
  return custom_element;
278 +
  return custom_max;
281 279
}
282 280
283 281

@@ -241,19 +241,18 @@
Loading
241 241
  // calling environment
242 242
  SEXP calling_env = PROTECT(LAZYVEC_PACKAGE_ENV(x));
243 243
  
244 -
  // length listener method
244 +
  // min listener method
245 245
  SEXP min_listener = PROTECT(VECTOR_ELT(LAZYVEC_DIAGNOSTICS(x), LAZYVEC_METHOD_MIN));
246 246
  
247 247
  // na_rm argument
248 -
  SEXP na_rm_arg = PROTECT(Rf_ScalarInteger(na_rm));
248 +
  SEXP na_rm_arg = PROTECT(Rf_ScalarLogical(na_rm));
249 249
  
250 -
  // ALTREP override
251 -
  // should return a length 1 vector containing the element
252 -
  SEXP custom_element = PROTECT(call_dual_r_interface(min_listener, user_data, na_rm_arg, calling_env));
250 +
  // returns SEXP (integer or double)
251 +
  SEXP custom_min = PROTECT(call_dual_r_interface(min_listener, user_data, na_rm_arg, calling_env));
253 252
  
254 -
  UNPROTECT(5);  // last PROTECT could be removed
253 +
  UNPROTECT(5);
255 254
  
256 -
  return custom_element;
255 +
  return custom_min;
257 256
}
258 257
259 258
@@ -265,19 +264,18 @@
Loading
265 264
  // calling environment
266 265
  SEXP calling_env = PROTECT(LAZYVEC_PACKAGE_ENV(x));
267 266
  
268 -
  // length listener method
267 +
  // max listener method
269 268
  SEXP max_listener = PROTECT(VECTOR_ELT(LAZYVEC_DIAGNOSTICS(x), LAZYVEC_METHOD_MAX));
270 269
  
271 270
  // na_rm argument
272 -
  SEXP na_rm_arg = PROTECT(Rf_ScalarInteger(na_rm));
271 +
  SEXP na_rm_arg = PROTECT(Rf_ScalarLogical(na_rm));
273 272
  
274 -
  // ALTREP override
275 -
  // should return a length 1 vector containing the element
276 -
  SEXP custom_element = PROTECT(call_dual_r_interface(max_listener, user_data, na_rm_arg, calling_env));
273 +
  // returns SEXP (integer or double)
274 +
  SEXP custom_max = PROTECT(call_dual_r_interface(max_listener, user_data, na_rm_arg, calling_env));
277 275
  
278 -
  UNPROTECT(5);  // last PROTECT could be removed
276 +
  UNPROTECT(5);
279 277
  
280 -
  return custom_element;
278 +
  return custom_max;
281 279
}
282 280
283 281
Files Coverage
R 58.40%
src 26.78%
Project Totals (23 files) 31.62%
Sunburst
The inner-most circle is the entire project, moving away from the center are folders then, finally, a single file. The size and color of each slice is representing the number of statements and the coverage, respectively.
Icicle
The top section represents the entire project. Proceeding with folders and finally individual files. The size and color of each slice is representing the number of statements and the coverage, respectively.
Grid
Each block represents a single file in the project. The size and color of each block is represented by the number of statements and the coverage, respectively.
Loading