Compare ba07113 ... +2 ... bbc50b1

Showing 8 of 56 files from the diff.
Other files ignored by Codecov

@@ -69,7 +69,7 @@
Loading
69 69
  df.out[,estimate_col] = as.character(df.out[,estimate_col])
70 70
  df.out[is.na(df.out[,estimate_col]),estimate_col] = ref_symbol
71 71
  df.out = df.out[order(df.out$index),]
72 -
  if(last_merge == TRUE){
72 +
  if(last_merge){
73 73
    df.out = df.out %>% 
74 74
      dplyr::select(-fit_id, -index)
75 75
  }

@@ -27,7 +27,7 @@
Loading
27 27
28 28
ff_glimpse <- function(.data, dependent=NULL, explanatory=NULL, digits = 1,
29 29
											 levels_cut = 5){
30 -
	if(is.null(dependent) && is.null(explanatory)){
30 +
	if(all(is.null(dependent), is.null(explanatory))){
31 31
		df.in = .data
32 32
	} else {
33 33
		df.in = .data %>% dplyr::select(dependent, explanatory)

@@ -44,7 +44,7 @@
Loading
44 44
#'
45 45
#' # Select a tibble and expand
46 46
#' out$counts[[9]] %>%
47 -
#'   print(n = Inf)
47 +
#'   print()
48 48
#' # Note this variable (node4) appears miscoded in original dataset survival::colon.
49 49
#' 
50 50
#' # Choose to only include variables that you actually use. 

@@ -53,13 +53,13 @@
Loading
53 53
  estimate_p = ifelse(estimate_p3==1, 1, estimate_p)
54 54
  estimate_p = apply(rbind(estimate_p*2, 1), 2, min)  #two-tailed, max 1
55 55
56 -
  if(condense==FALSE){
56 +
  if(!condense){
57 57
    df.out = data.frame(estimate_centre, estimate_conf.low, estimate_conf.high, estimate_p,
58 58
                        stringsAsFactors=FALSE)
59 59
    colnames(df.out) = c(comparison, paste0(comparison, "_conf.low"),
60 60
                         paste0(comparison, "_conf.high"), paste0(comparison, "_p"))
61 61
    df.out = rbind(null_ref, df.out)
62 -
  }else if(condense==TRUE){
62 +
  }else if(condense){
63 63
    estimate_centre = round_tidy(estimate_centre, digits[1])
64 64
    estimate_conf.low = round_tidy(estimate_conf.low, digits[1])
65 65
    estimate_conf.high = round_tidy(estimate_conf.high, digits[1])

@@ -156,18 +156,18 @@
Loading
156 156
											 estimate_name=estimate_name, estimate_suffix=estimate_suffix,
157 157
											 p_name=p_name, digits=digits,)
158 158
	
159 -
	if (condense==TRUE){
159 +
	if (condense){
160 160
		df.out = condense_fit(df.out, explanatory_name=explanatory_name,
161 161
													estimate_name=estimate_name, estimate_suffix=estimate_suffix,
162 162
													p_name=p_name, digits=digits, confint_sep=confint_sep)
163 163
	}
164 164
	
165 -
	if (remove_intercept==TRUE){
165 +
	if (remove_intercept){
166 166
		df.out = remove_intercept(df.out)
167 167
	}
168 168
	
169 169
	# Extract model metrics
170 -
	if (metrics==TRUE){
170 +
	if (metrics){
171 171
		metrics.out = ff_metrics(.data)
172 172
		return(list(df.out, metrics.out))
173 173
	} else {
@@ -193,7 +193,7 @@
Loading
193 193
													confint_level = 0.95,
194 194
													confint_sep = " to ", ...){
195 195
	
196 -
	if (metrics==TRUE && length(.data)>1){
196 +
	if (all(metrics, length(.data)>1)){
197 197
		stop("Metrics only generated for single models: multiple models supplied to function")
198 198
	}
199 199
	
@@ -202,18 +202,18 @@
Loading
202 202
									 estimate_name=estimate_name, estimate_suffix=estimate_suffix,
203 203
									 p_name=p_name,  confint_level=confint_level)
204 204
	
205 -
	if (condense==TRUE){
205 +
	if (condense){
206 206
		df.out = condense_fit(df.out, explanatory_name=explanatory_name,
207 207
													estimate_name=estimate_name, estimate_suffix=estimate_suffix,
208 208
													p_name=p_name, digits=digits, confint_sep=confint_sep)
209 209
	}
210 210
	
211 -
	if (remove_intercept==TRUE){
211 +
	if (remove_intercept){
212 212
		df.out = remove_intercept(df.out)
213 213
	}
214 214
	
215 215
	# Extract model metrics
216 -
	if (metrics==TRUE){
216 +
	if (metrics){
217 217
		metrics.out = ff_metrics(.data)
218 218
		return(list(df.out, metrics.out))
219 219
	} else {
@@ -251,18 +251,18 @@
Loading
251 251
											 confint_level = confint_level,
252 252
											 p_name=p_name)
253 253
	
254 -
	if (condense==TRUE){
254 +
	if (condense){
255 255
		df.out = condense_fit(df.out, explanatory_name = explanatory_name,
256 256
													estimate_name = estimate_name, estimate_suffix = estimate_suffix,
257 257
													p_name = p_name, digits = digits, confint_sep = confint_sep)
258 258
	}
259 259
	
260 -
	if (remove_intercept==TRUE){
260 +
	if (remove_intercept){
261 261
		df.out = remove_intercept(df.out)
262 262
	}
263 263
	
264 264
	# Extract model metrics
265 -
	if (metrics==TRUE){
265 +
	if (metrics){
266 266
		metrics.out = ff_metrics(.data)
267 267
		return(list(df.out, metrics.out))
268 268
	} else {
@@ -285,7 +285,7 @@
Loading
285 285
													p_name = "p",
286 286
													digits=c(2,2,3),
287 287
													confint_sep = "-", ...){
288 -
	if(metrics == TRUE) warning("Metrics not currently available for this model")
288 +
	if(metrics) warning("Metrics not currently available for this model")
289 289
	
290 290
	x = .data
291 291
	d.estimate = digits[1]
@@ -308,13 +308,13 @@
Loading
308 308
	df.out$p = round(df.out$p, d.p)
309 309
	colnames(df.out) = c(explanatory_name, paste0(estimate_name, estimate_suffix), "L95", "U95", p_name)
310 310
	
311 -
	if (condense==TRUE){
311 +
	if (condense){
312 312
		df.out = condense_fit(df.out, explanatory_name=explanatory_name,
313 313
													estimate_name=estimate_name, estimate_suffix=estimate_suffix,
314 314
													p_name=p_name, digits=digits, confint_sep=confint_sep)
315 315
	}
316 316
	
317 -
	if (remove_intercept==TRUE){
317 +
	if (remove_intercept){
318 318
		df.out = remove_intercept(df.out)
319 319
	}
320 320
	
@@ -340,7 +340,7 @@
Loading
340 340
													 confint_level = 0.95,
341 341
													 confint_sep = "-", ...){
342 342
	
343 -
	if (metrics==TRUE && length(.data)>1){
343 +
	if (all(metrics, length(.data)>1)){
344 344
		stop("Metrics only generated for single models: multiple models supplied to function")
345 345
	}
346 346
	
@@ -352,18 +352,18 @@
Loading
352 352
									 confint_level = confint_level,
353 353
									 digits=digits)
354 354
	
355 -
	if (condense == TRUE){
355 +
	if (condense){
356 356
		df.out = condense_fit(.data=df.out, explanatory_name=explanatory_name,
357 357
													estimate_name=estimate_name, estimate_suffix=estimate_suffix,
358 358
													p_name=p_name, digits=digits, confint_sep=confint_sep)
359 359
	}
360 360
	
361 -
	if (remove_intercept == TRUE){
361 +
	if (remove_intercept){
362 362
		df.out = remove_intercept(df.out)
363 363
	}
364 364
	
365 365
	# Extract model metrics
366 -
	if (metrics == TRUE){
366 +
	if (metrics){
367 367
		metrics.out = ff_metrics(.data)
368 368
		return(list(df.out, metrics.out))
369 369
	} else {
@@ -391,7 +391,7 @@
Loading
391 391
													 confint_level = 0.95,
392 392
													 confint_sep = "-", ...){
393 393
	
394 -
	if (metrics==TRUE && length(.data)>1){
394 +
	if (metrics && length(.data)>1){
395 395
		stop("Metrics only generated for single models: multiple models supplied to function")
396 396
	}
397 397
	
@@ -403,18 +403,18 @@
Loading
403 403
									 confint_level = confint_level,
404 404
									 digits=digits)
405 405
	
406 -
	if (condense==TRUE){
406 +
	if (condense){
407 407
		df.out = condense_fit(.data=df.out, explanatory_name=explanatory_name,
408 408
													estimate_name=estimate_name, estimate_suffix=estimate_suffix,
409 409
													p_name=p_name, digits=digits, confint_sep=confint_sep)
410 410
	}
411 411
	
412 -
	if (remove_intercept==TRUE){
412 +
	if (remove_intercept){
413 413
		df.out = remove_intercept(df.out)
414 414
	}
415 415
	
416 416
	# Extract model metrics
417 -
	if (metrics==TRUE){
417 +
	if (metrics){
418 418
		metrics.out = ff_metrics(.data)
419 419
		return(list(df.out, metrics.out))
420 420
	} else {
@@ -448,18 +448,18 @@
Loading
448 448
											 estimate_name=estimate_name, estimate_suffix=estimate_suffix,
449 449
											 p_name=p_name, confint_type = confint_type, confint_level = confint_level)
450 450
	
451 -
	if (condense==TRUE){
451 +
	if (condense){
452 452
		df.out = condense_fit(df.out, explanatory_name=explanatory_name,
453 453
													estimate_name=estimate_name, estimate_suffix=estimate_suffix,
454 454
													p_name=p_name, digits=digits, confint_sep=confint_sep)
455 455
	}
456 456
	
457 -
	if (remove_intercept==TRUE){
457 +
	if (remove_intercept){
458 458
		df.out = remove_intercept(df.out)
459 459
	}
460 460
	
461 461
	# Extract model metrics
462 -
	if (metrics==TRUE){
462 +
	if (metrics){
463 463
		metrics.out = ff_metrics(.data)
464 464
		return(list(df.out, metrics.out))
465 465
	} else {
@@ -494,19 +494,19 @@
Loading
494 494
											 p_name=p_name, confint_type = confint_type,
495 495
											 confint_level = confint_level)
496 496
	
497 -
	if (condense==TRUE){
497 +
	if (condense){
498 498
		df.out = condense_fit(df.out, explanatory_name=explanatory_name,
499 499
													estimate_name=estimate_name, estimate_suffix=estimate_suffix,
500 500
													p_name=p_name, digits=digits, confint_sep=confint_sep)
501 501
	}
502 502
	
503 -
	if (remove_intercept==TRUE){
503 +
	if (remove_intercept){
504 504
		df.out = remove_intercept(df.out)
505 505
	}
506 506
	
507 507
	
508 508
	# Extract model metrics
509 -
	if (metrics==TRUE){
509 +
	if (metrics){
510 510
		metrics.out = ff_metrics(.data)
511 511
		return(list(df.out, metrics.out))
512 512
	} else {
@@ -534,13 +534,13 @@
Loading
534 534
											 estimate_name=estimate_name, estimate_suffix=estimate_suffix,
535 535
											 p_name=p_name)
536 536
	
537 -
	if (condense==TRUE){
537 +
	if (condense){
538 538
		df.out = condense_fit(.data=df.out, explanatory_name=explanatory_name,
539 539
													estimate_name=estimate_name, estimate_suffix=estimate_suffix,
540 540
													p_name=p_name, digits=digits, confint_sep=confint_sep)
541 541
	}
542 542
	# Extract model metrics
543 -
	if (metrics==TRUE){
543 +
	if (metrics){
544 544
		metrics.out = ff_metrics(.data)
545 545
		return(list(df.out, metrics.out))
546 546
	} else {
@@ -563,21 +563,21 @@
Loading
563 563
														 p_name = "p",
564 564
														 digits=c(2,2,3),
565 565
														 confint_sep = "-", ...){
566 -
	#if(metrics==TRUE) warning("Metrics not currently available for this model")
566 +
	#if(metrics) warning("Metrics not currently available for this model")
567 567
	
568 568
	df.out = .data %>% 
569 569
		purrr::map_dfr(extract_fit, explanatory_name=explanatory_name,
570 570
									 estimate_name=estimate_name, estimate_suffix=estimate_suffix,
571 571
									 p_name=p_name, digits=digits)
572 572
	
573 -
	if (condense==TRUE){
573 +
	if (condense){
574 574
		df.out = condense_fit(.data=df.out, explanatory_name=explanatory_name,
575 575
													estimate_name=estimate_name, estimate_suffix=estimate_suffix,
576 576
													p_name=p_name, digits=digits, confint_sep=confint_sep)
577 577
	}
578 578
	
579 579
	# Extract model metrics
580 -
	if (metrics==TRUE){
580 +
	if (metrics){
581 581
		metrics.out = ff_metrics(.data)
582 582
		return(list(df.out, metrics.out))
583 583
	} else {
@@ -606,13 +606,13 @@
Loading
606 606
											 estimate_name=estimate_name, estimate_suffix=estimate_suffix,
607 607
											 p_name=p_name)
608 608
	
609 -
	if (condense==TRUE){
609 +
	if (condense){
610 610
		df.out = condense_fit(.data=df.out, explanatory_name=explanatory_name,
611 611
													estimate_name=estimate_name, estimate_suffix=estimate_suffix,
612 612
													p_name=p_name, digits=digits, confint_sep=confint_sep)
613 613
	}
614 614
	# Extract model metrics
615 -
	if (metrics==TRUE){
615 +
	if (metrics){
616 616
		metrics.out = ff_metrics(.data)
617 617
		return(list(df.out, metrics.out))
618 618
	} else {
@@ -641,13 +641,13 @@
Loading
641 641
											 estimate_name=estimate_name, estimate_suffix=estimate_suffix,
642 642
											 p_name=p_name)
643 643
	
644 -
	if (condense==TRUE){
644 +
	if (condense){
645 645
		df.out = condense_fit(.data=df.out, explanatory_name=explanatory_name,
646 646
													estimate_name=estimate_name, estimate_suffix=estimate_suffix,
647 647
													p_name=p_name, digits=digits, confint_sep=confint_sep)
648 648
	}
649 649
	# Extract model metrics
650 -
	if (metrics==TRUE){
650 +
	if (metrics){
651 651
		metrics.out = ff_metrics(.data)
652 652
		return(list(df.out, metrics.out))
653 653
	} else {
@@ -682,13 +682,13 @@
Loading
682 682
									 p_name=p_name, digits=digits)
683 683
684 684
	
685 -
	if (condense==TRUE){
685 +
	if (condense){
686 686
		df.out = condense_fit(.data=df.out, explanatory_name=explanatory_name,
687 687
													estimate_name=estimate_name, estimate_suffix=estimate_suffix,
688 688
													p_name=p_name, digits=digits, confint_sep=confint_sep)
689 689
	}
690 690
	# Extract model metrics
691 -
	if (metrics==TRUE){
691 +
	if (metrics){
692 692
		metrics.out = ff_metrics(.data)
693 693
		return(list(df.out, metrics.out))
694 694
	} else {
@@ -726,19 +726,19 @@
Loading
726 726
											 estimate_name=estimate_name, estimate_suffix=estimate_suffix,
727 727
											 p_name=p_name, digits=digits, X=args$X)
728 728
729 -
	if (condense==TRUE){
729 +
	if (condense){
730 730
		df.out = condense_fit(df.out, explanatory_name=explanatory_name,
731 731
													estimate_name=estimate_name, estimate_suffix=estimate_suffix,
732 732
													p_name=p_name, digits=digits, confint_sep=confint_sep)
733 733
	}
734 734
735 -
	if (remove_intercept==TRUE){
735 +
	if (remove_intercept){
736 736
		df.out = remove_intercept(df.out)
737 737
	}
738 738
739 739
	# Extract model metrics
740 740
	## This needs an ff_metrics() method
741 -
	if (metrics==TRUE){
741 +
	if (metrics){
742 742
		# n_data = dim(x$data)[1] # no equivalent here
743 743
		n_model = dim(args$X)[1]
744 744
		# aic = round(x$aic, 1) # add WAIC later?
@@ -751,7 +751,7 @@
Loading
751 751
		#	", C-statistic = ", auc)
752 752
	}
753 753
754 -
	if (metrics==TRUE){
754 +
	if (metrics){
755 755
		return(list(df.out, metrics.out))
756 756
	} else {
757 757
		return(df.out)
@@ -785,19 +785,19 @@
Loading
785 785
		dplyr::select(explanatory_name = term, estimate, `2.5 %`, `97.5 %`, p.value)
786 786
	colnames(df.out) = c(explanatory_name, estimate_name, "L95", "U95", "p")
787 787
	
788 -
	if (condense==TRUE){
788 +
	if (condense){
789 789
		df.out = condense_fit(df.out, explanatory_name = explanatory_name,
790 790
													estimate_name = estimate_name, estimate_suffix = estimate_suffix,
791 791
													p_name = p_name, digits = digits, confint_sep = confint_sep)
792 792
	}
793 793
	
794 -
	if (remove_intercept==TRUE){
794 +
	if (remove_intercept){
795 795
		df.out = remove_intercept(df.out)
796 796
	}
797 797
	
798 798
	# Extract model metrics
799 799
	## Not implemented for mipo
800 -
	# if (metrics==TRUE){
800 +
	# if (metrics){
801 801
	#   metrics.out = ff_metrics(.data)
802 802
	#   return(list(df.out, metrics.out))
803 803
	# } else {

Click to load this diff.
Loading diff...

Click to load this diff.
Loading diff...

Click to load this diff.
Loading diff...

Everything is accounted for!

No changes detected that need to be reviewed.
What changes does Codecov check for?
Lines, not adjusted in diff, that have changed coverage data.
Files that introduced coverage data that had none before.
Files that have missing coverage data that once were tracked.
Files Coverage
R 82.41%
Project Totals (39 files) 82.41%
Loading