MyNixOS website logo
Description

Detect SDGs and Targets in Text.

Identify 17 Sustainable Development Goals and associated 169 targets in text.

CRAN_Status_Badge DOI License: GPL v3 CRAN downloadcount CRAN downloadcount Visitor Badge DOI

SDG Detector

In 2015, leaders worldwide adopted 17 Sustainable Development Goals (SDGs) with 169 targets to be achieved by 2030 (https://sdgs.un.org). 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:

install.packages("SDGdetector")

2. GitHub

You can alternatively install the development version of SDGdetector from GitHub as follows:

if (!require("remotes")) {
  install.packages("remotes")
}

remotes::install_github("Yingjie4Science/SDGdetector")

Example Usage

To detect SDGs from text

library(SDGdetector)

### 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

x = 'China and USA devoted the largest efforts on solar energy'
detect_region(x)

To use specific SDG colors

sdg_color(1)
sdg_color(x = 1:17)

To use specific SDG icons

sdg_icon(x = 7, res = 300)

To visualize SDG on a bar plot

data("sdgstat")
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. https://doi.org/10.21105/joss.05124.

A BibTeX entry for LaTeX users is

  @Article{,
    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 = {https://github.com/Yingjie4Science/SDGdetector}
  }

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.

Metadata

Version

2.7.3

License

Unknown

Platforms (75)

    Darwin
    FreeBSD
    Genode
    GHCJS
    Linux
    MMIXware
    NetBSD
    none
    OpenBSD
    Redox
    Solaris
    WASI
    Windows
Show all
  • aarch64-darwin
  • aarch64-genode
  • aarch64-linux
  • aarch64-netbsd
  • aarch64-none
  • aarch64_be-none
  • arm-none
  • armv5tel-linux
  • armv6l-linux
  • armv6l-netbsd
  • armv6l-none
  • armv7a-darwin
  • armv7a-linux
  • armv7a-netbsd
  • armv7l-linux
  • armv7l-netbsd
  • avr-none
  • i686-cygwin
  • i686-darwin
  • i686-freebsd
  • i686-genode
  • i686-linux
  • i686-netbsd
  • i686-none
  • i686-openbsd
  • i686-windows
  • javascript-ghcjs
  • loongarch64-linux
  • m68k-linux
  • m68k-netbsd
  • m68k-none
  • microblaze-linux
  • microblaze-none
  • microblazeel-linux
  • microblazeel-none
  • mips-linux
  • mips-none
  • mips64-linux
  • mips64-none
  • mips64el-linux
  • mipsel-linux
  • mipsel-netbsd
  • mmix-mmixware
  • msp430-none
  • or1k-none
  • powerpc-netbsd
  • powerpc-none
  • powerpc64-linux
  • powerpc64le-linux
  • powerpcle-none
  • riscv32-linux
  • riscv32-netbsd
  • riscv32-none
  • riscv64-linux
  • riscv64-netbsd
  • riscv64-none
  • rx-none
  • s390-linux
  • s390-none
  • s390x-linux
  • s390x-none
  • vc4-none
  • wasm32-wasi
  • wasm64-wasi
  • x86_64-cygwin
  • x86_64-darwin
  • x86_64-freebsd
  • x86_64-genode
  • x86_64-linux
  • x86_64-netbsd
  • x86_64-none
  • x86_64-openbsd
  • x86_64-redox
  • x86_64-solaris
  • x86_64-windows