This function extracts a JSON object from a raw string containing extra text (such as descriptive headers or backticks) and converts it into a tidy data frame. Each row corresponds to a region, and columns correspond to the associated metrics.

parse_plausibility_json(raw_string)

Arguments

raw_string

Character. The raw string containing JSON data. The JSON can be surrounded by descriptive text or backticks.

Value

A data frame where each row is a brain region (or IDP) and columns are the metrics parsed from the JSON. Numeric values are converted to numeric. Regions with differing metric sets are filled with NA.

Examples

if (FALSE) { # \dontrun{
df <- parse_plausibility_json(hellyes)
head(df)
} # }