add_key_prefix: Add prefixes to keys.

View source: R/key_prefixes.R

add_key_prefixR Documentation

Add prefixes to keys.

Description

Keys in the master calendar's cal_key column have prefixes according to the type of calendar entry they represent (e.g., "LAB_" for labs, "CLS_" for classes/reading assignments, "EXAM_" for exams, etc.). This function adds those prefixes.

Usage

add_key_prefix(x, type, ...)

## S3 method for class 'character'
add_key_prefix(x, type, ...)

## S3 method for class 'list'
add_key_prefix(x, type, ...)

## S3 method for class 'data.frame'
add_key_prefix(df, type, col = "cal_key")

Arguments

x

The object to process.

type

The type of prefix to add (e.g., "class", "lab", etc.)

...

Arguments passed to methods.

df

The object to process.

col

The column to process

Value

A data frame with the prefixes stripped from the specified column.

A data frame with the prefixes stripped from the specified column.

Methods (by class)

  • add_key_prefix(character): Add key prefixes to a character vector.

  • add_key_prefix(list): Add key prefixes to a list of character objects.

  • add_key_prefix(data.frame): Add key prefix to a column in a data frame.

See Also

strip_key_prefix

strip_key_prefix


jonathan-g/semestr documentation built on Jan. 23, 2025, 3:10 p.m.