Learn R Programming

SDGdetector (version 2.7.3)

summarize_sdg: Summarize results from SDGdetector at either the Goal level or Target level.

Description

Summarize results from SDGdetector at either the Goal level or Target level.

Usage

summarize_sdg(data, sum_by = "target", quiet = FALSE)

Value

Data frame with at least one column named "SDG" or "Target", and one column Freq that represent the total hits.

Arguments

data

Data frame or a string

sum_by

The group level to be chosen for data summary. Default parameter is "target", and can also set at "goal" level.

quiet

Logical. Suppress info message

Examples

Run this code
library(SDGdetector)
df <- data.frame(col = c(
    'our goal is to end poverty globally',
    'this product contributes to slowing down climate change'))
data <- SDGdetector(x = df, col = col)
summarize_sdg(data, sum_by = 'target', quiet = FALSE)

Run the code above in your browser using DataLab