Open Sustainable Technology

A curated list of open technology projects to sustain a stable climate, energy supply, biodiversity and natural resources.

Browse accepted projects | Review proposed projects | Propose new project | Open Issues

SDG Detector

Identify and visualize 17 Sustainable Development Goals and associated 169 Targets in text.

cran r r-package sdg sdgs sustainability sustainable-development-goals text-mining

Last synced: about 10 hours ago
JSON representation

Repository metadata

A novel R package that can identify and visualize 17 Sustainable Development Goals and associated 169 Targets in text



[![License: GPL v3](](
[![CRAN downloadcount](](
[![CRAN downloadcount](](
![Visitor Badge](

# SDG Detector

In 2015, leaders worldwide adopted 17 Sustainable Development Goals (SDGs) with 169 targets to be achieved by 2030 ( The framework of SDGs serves as a blueprint for shared prosperity for both people and the earth. `SDGdetector` identifies both direct and indirect expressions of SDGs and associated targets in chunks of text. It takes a data frame with a specified column of text to process as inputs, and outputs a data frame with original columns plus matched SDGs and targets.

## Installation

There are two ways to install the **SDGdetector** R package.

### 1. CRAN

**SDGdetector** is now available on
[CRAN](, so you can install it with:

``` r

### 2. GitHub

You can alternatively install the development version of **SDGdetector** from [GitHub]( as follows:

``` r
if (!require("remotes")) {


## Example Usage

**To detect SDGs from text**
``` r

### string as input data
text <- 'our goal is to mitigate climate change, end poverty, and reduce inequality globally'
SDGdetector(x = text)

### dataframe as input data
df <- data.frame(col = c(
'our goal is to end poverty globally',
'this product contributes to slowing down climate change'))
SDGdetector(x = df, col = col)

**To detect regions/countries in text**
``` r
x = 'China and USA devoted the largest efforts on solar energy'

**To use specific SDG colors**
``` r
sdg_color(x = 1:17)

**To use specific SDG icons**
``` r
sdg_icon(x = 7, res = 300)

**To visualize SDG on a bar plot**
``` r
df <- sdgstat

# plot SDG on a bar plot
plot_sdg_bar(data = df, sdg = SDG, value = Value)

**To visualize SDG on a map**
# plot SDG by country on a map
plot_sdg_map(data = df, sdg = SDG, value = Value, country = Country, by_sdg = F)

## Accuracy Evaluation

This package has achieved high accuracy in detecting SDG-related statements within textual data (> 75%, measured by the alignment between the R package results and four experts' manually-coded results; see this [supplementary document]( for more information. The data and code for reproducing the performance metrics can be found in this repo under [`./docs/accuracy_evaluation/`](

The overall accuracy (left) and the accuracy for each round of inspection (right). The red squared dot in the left plot indicates the mean value and the hollow round dots represent the accuracy values reported by each expert.

## License

The SDGdetector **R** package is distributed under the [GNU General Public License v3.0](

## How to Cite

Get citation information for *SDGdetector* in R doing
`citation(package = 'SDGdetector')`

To cite SDGdetector in publications, please use:

Li, Y., Frans, V.F., Song, Y., Cai, M., Zhang, Y., Liu, J. (2023). SDGdetector: an R-based text mining tool for quantifying efforts toward Sustainable Development Goals. Journal of Open Source Software 8(84), 5124.

A BibTeX entry for LaTeX users is

title = {SDGdetector: an R-based text mining tool for quantifying efforts toward Sustainable Development Goals},
author = {Yingjie Li and Veronica F. Frans and Yongze Song and Meng Cai and Yuqian Zhang and Jianguo Liu},
journal = {Journal of Open Source Software},
year = {2023},
volume = {8},
number = {84},
pages = {5124},
doi = {10.21105/joss.05124},
url = {}

## Reporting Bugs

*SDGdetector* is distributed as is and without warranty of suitability for application. If you encounter flaws with the software (i.e. bugs) please report the issue. Providing a detailed description of the conditions under which the bug occurred will help to identify the bug. *Use the [Issues tracker]( on GitHub to report issues with the software and to request feature enhancements.*

Owner metadata

GitHub Events

Last Year

Committers metadata

Last synced: 1 day ago

Total Commits: 314
Total Committers: 5
Avg Commits per committer: 62.8
Development Distribution Score (DDS): 0.392

Commits in past year: 51
Committers in past year: 2
Avg Commits per committer in past year: 25.5
Development Distribution Score (DDS) in past year: 0.294

Name Email Commits
YingjieLiScience y****u@g****m 191
Yingjie4Science Y****e 95
Cai, Meng m****1@g****m 23
Veronica F. Frans 4****s 3
caimeng2 5****2 2

Committer domains:

Issue and Pull Request metadata

Last synced: 1 day ago

Total issues: 5
Total pull requests: 0
Average time to close issues: about 2 months
Average time to close pull requests: N/A
Total issue authors: 5
Total pull request authors: 0
Average comments per issue: 6.4
Average comments per pull request: 0
Merged pull request: 0
Bot issues: 0
Bot pull requests: 0

Past year issues: 1
Past year pull requests: 0
Past year average time to close issues: 4 days
Past year average time to close pull requests: N/A
Past year issue authors: 1
Past year pull request authors: 0
Past year average comments per issue: 12.0
Past year average comments per pull request: 0
Past year merged pull request: 0
Past year bot issues: 0
Past year bot pull requests: 0

More stats:

Top Issue Authors

  • caimeng2 (1)
  • caleblucas (1)
  • csaybar (1)
  • v-gestern (1)
  • Yingjie4Science (1)

Top Pull Request Authors

Top Issue Labels

  • documentation (1)

Top Pull Request Labels

Package metadata seesus

a social, environmental, and economic sustainability classifier based on the UN Sustainable Development Goals

  • Homepage:
  • Documentation:
  • Licenses: GPL-3.0
  • Latest release: 1.2.0 (published 4 months ago)
  • Last Synced: 2024-02-27T18:01:36.299Z (1 day ago)
  • Versions: 3
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Downloads: 33 Last month
  • Rankings:
    • Dependent packages count: 7.306%
    • Average: 37.886%
    • Dependent repos count: 68.466%
  • Maintainers (2) SDGdetector

Detect SDGs and Targets in Text

  • Homepage:
  • Documentation:
  • Licenses: GPL (≥ 3)
  • Latest release: 2.7.3 (published 9 months ago)
  • Last Synced: 2024-02-27T18:01:36.089Z (1 day ago)
  • Versions: 4
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Downloads: 183 Last month
  • Rankings:
    • Dependent packages count: 29.797%
    • Dependent repos count: 35.455%
    • Average: 38.803%
    • Downloads: 51.159%
  • Maintainers (1)


  • R >= 3.5.0 depends
  • dplyr * imports
  • magrittr * imports
  • stringr * imports
  • testthat * suggests
.github/workflows/draft-pdf.yml actions
  • actions/checkout v2 composite
  • actions/upload-artifact v1 composite
  • openjournals/openjournals-draft-action master composite
  • stefanzweifel/git-auto-commit-action v4 composite

Score: 9.558882332684727