Skip to contents

Plot a line graph of a set of scores against a single column in a data frame. Can be used to evaluate whether a score is useful in determining some other factor.

Usage

score_performance(df, colname, scores)

Arguments

df

A data frame to be plotted.

colname

The name of the column to plot.

scores

A data frame containing a set of numerical scores. If your data frame has been scored using apply_scores(), use get_scores() to extract the actual scores.

Examples

data <- tibble::tibble(
  x = 1:10
)

scores <- create_score(
  scores_init,
  score_type = "Linear", colname = "x", score_name = "Default",
  weight = 1, lb = 1, ub = 6, exponential = FALSE
)
scores <- create_score(
  scores,
  score_type = "Peak", colname = "x", score_name = "Peak score",
  weight = 2, lb = 2, ub = 8, centre = 5, inverse = FALSE,
  exponential = FALSE
)

scored <- apply_scores(data, scores)
score_performance(
  scored,
  colname = "x",
  scores = get_scores(scored, scores, final_score = FALSE)
)