extract_meta {ottrpal} | R Documentation |
Extract meta fields from a tag
Description
Extract meta fields from a tag
Usage
extract_meta(tags)
Arguments
tags |
A single tag or vector of tags to extract the fields from. |
Value
A named vector indicating the field and entry associated with it.
Examples
### Simple example
tag <- "{quiz, id: quiz_name_here, attempts: 10}"
# Extract metadata tags
meta <- extract_meta(tag)
### Example using a file
quiz_path <- good_quiz_path()
quiz_lines <- readLines(quiz_path)
# Put this in a data.frame so we can identify the content
quiz_df <- parse_quiz_df(quiz_lines)
# Extract the tags
tags <- quiz_df %>%
dplyr::filter(type == "tag") %>%
dplyr::pull("original")
# Extract metadata tags
meta <- extract_meta(tags)
[Package ottrpal version 1.2.1 Index]