pretty_condprob: Append Row Number as a Variable to a Dataframe

View source: R/pretty_condprob.R

pretty_condprobR Documentation

Append Row Number as a Variable to a Dataframe

Description

This function takes a dataframe and adds a variable of row numbers. This is the simplest function that does not take into account any group structures.

Usage

pretty_condprob(
  df,
  A_var,
  A_val,
  B_var,
  B_val,
  output = "string",
  digits = 1,
  percent = TRUE
)

Arguments

df

Input dataframe.

A_var

The A variable in "the conditional probability of A given B."

A_val

Value of A variable in interest.

B_var

The B variable in "the conditional probability of A given B."

B_val

Value of B variable in interest.

output

Whether to print a numeric number or a statement. If the argument is "string", the function prints a message containing the conditional probability. Defaults to "string."

digits

The digit of the final output. Defaults to 1.

percent

Whether to display the conditional probability in a percentage. Defaults to TRUE.#'


sysilviakim/Kmisc documentation built on Jan. 28, 2023, 10:58 a.m.