get_non_empty_fields_by_prefix: Get non-empty values from fields with a specific prefix

View source: R/format_questions_extended.R

get_non_empty_fields_by_prefixR Documentation

Get non-empty values from fields with a specific prefix

Description

This function takes a dataframe, a row index, and a prefix, returning a vector with the content of columns that start with the given prefix and are not empty.

Usage

get_non_empty_fields_by_prefix(df, i, prefix)

Arguments

df

A dataframe containing the relevant columns.

i

An integer representing the row index.

prefix

A string representing the prefix of the column names (e.g., "a_", "fb_a_", "tag_").

Value

A vector with non-empty values from the fields with the given prefix in the specified row.


moodef documentation built on April 12, 2025, 1:42 a.m.