#49 Improve checks, ignore top level files

Open NelsonGon Nelson-Gon
Showing 9 of 58 files from the diff.
Other files ignored by Codecov
man/crruni.Rd has changed.
man/lmuni.Rd has changed.
man/hr_plot.Rd has changed.
man/ff_permute.Rd has changed.
man/ff_merge.Rd has changed.
man/surv_plot.Rd has changed.
man/svyglmuni.Rd has changed.
man/wcgs.Rd has changed.
man/coxphmulti.Rd has changed.
man/finalfit.Rd has changed.
man/colon_s.Rd has changed.
man/coxphuni.Rd has changed.
man/ff_glimpse.Rd has changed.
man/lmmixed.Rd has changed.
man/fit2df.Rd has changed.
NAMESPACE has changed.
man/ff_plot.Rd has changed.
man/glmmulti.Rd has changed.
man/lmmulti.Rd has changed.
DESCRIPTION has changed.
man/glmuni.Rd has changed.
man/glmmixed.Rd has changed.
man/crrmulti.Rd has changed.
man/ff_newdata.Rd has changed.
man/or_plot.Rd has changed.

@@ -1,5 +1,5 @@
Loading
1 1
#' Label a variable
2 -
#'
2 +
#' 
3 3
#' @param .var Quoted variable name
4 4
#' @param variable_label Quoted variable label
5 5
#'
@@ -153,7 +153,7 @@
Loading
153 153
154 154
#' Labels to column names
155 155
#'
156 -
#' @param .data 
156 +
#' @inheritParams ff_relabel_df 
157 157
#'
158 158
#' @return Data frame or tibble
159 159
#' @export
@@ -163,6 +163,7 @@
Loading
163 163
#' colon_s %>% 
164 164
#'   select(sex.factor) %>% 
165 165
#'   labels_to_column()
166 +
#'   
166 167
labels_to_column <- function(.data){
167 168
	.labels = extract_variable_label(.data)
168 169
	.labels2 = names(.labels)

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

@@ -42,24 +42,32 @@
Loading
42 42
  }
43 43
44 44
  if(is.null(dim(estimate))) estimate = matrix(estimate, ncol=1) #allow single vector to pass to apply
45 -
46 -
  estimate_centre = apply(estimate, 2, median)
47 -
  estimate_conf.low = apply(estimate, 2, quantile, probs = c(0.025))
48 -
  estimate_conf.high = apply(estimate, 2, quantile, probs = c(0.975))
49 -
  estimate_p1 = apply(estimate, 2, function(x) mean(x < null_ref ))
50 -
  estimate_p2 = apply(estimate, 2, function(x) mean(x > null_ref ))
51 -
  estimate_p3 = apply(estimate, 2, function(x) mean(x == null_ref ))
45 +
  # calculate estimates one
46 +
  estimates = sapply(estimate, function(x) {
47 +
    estimate_center <- median(x)
48 +
    estimate_conf.low <- quantile(x, probs = c(0.025))
49 +
    estimate_conf.high <- quantile(x, probs = c(0.975))
50 +
    estimate_p1 <- mean( x < null_ref)
51 +
    estimate_p2 <- mean( x > null_ref )
52 +
    estimate_p3 <- mean( x == null_ref )
53 +
    })
54 +
  estimate_centre = estimates["estimate_centre"]
55 +
  estimate_conf.low = estimates["estimate_conf.low"]
56 +
  estimate_conf.high = estimates["estimate_conf.low"]
57 +
  estimate_p1 = estimates["estimate_p1"]
58 +
  estimate_p2 = estimates["estimate_centre_p2"]
59 +
  estimate_p3 = estimates["estimate_centre_p3"]
52 60
  estimate_p = apply(rbind(estimate_p1, estimate_p2), 2, min)
53 61
  estimate_p = ifelse(estimate_p3==1, 1, estimate_p)
54 62
  estimate_p = apply(rbind(estimate_p*2, 1), 2, min)  #two-tailed, max 1
55 63
56 -
  if(condense==FALSE){
64 +
  if(!condense){
57 65
    df.out = data.frame(estimate_centre, estimate_conf.low, estimate_conf.high, estimate_p,
58 66
                        stringsAsFactors=FALSE)
59 67
    colnames(df.out) = c(comparison, paste0(comparison, "_conf.low"),
60 68
                         paste0(comparison, "_conf.high"), paste0(comparison, "_p"))
61 69
    df.out = rbind(null_ref, df.out)
62 -
  }else if(condense==TRUE){
70 +
  }else if(condense){
63 71
    estimate_centre = round_tidy(estimate_centre, digits[1])
64 72
    estimate_conf.low = round_tidy(estimate_conf.low, digits[1])
65 73
    estimate_conf.high = round_tidy(estimate_conf.high, digits[1])

Click to load this diff.
Loading diff...

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 0.06% 82.47%
Project Totals (39 files) 82.47%
Loading