GithubHelp home page GithubHelp logo

Comments (12)

Yingjie4Science avatar Yingjie4Science commented on August 31, 2024 1

@v-gestern Thanks for spotting the confusing description in the help function. I have revised the description as:
#' Data frame with the same columns as the df plus one extra column named "sdgs", which
#' list the occurrence (or hits) of SDG goals or targets detected from each sentence in rows.
#' Users can further use our function summarize_sdg() to clean the result for visulization.

For visualization, we need to further clean the data, so that one column is for individual SDG, and another column is about the total number of each SDG detected from the text. To achieve this, you can write your own function, but here is a new function summarize_sdg() I just added to save users' time. Please let me know if you have further questions.

#' An example to use the function (you might need to update the package or re-install it in order to use the updated functions)

library(SDGdetector)
df <- data.frame(col = c(
'our goal is to end poverty globally',
'this product contributes to slowing down climate change'))
d <- SDGdetector(x = df, col = col)
data <- summarize_sdg(d, sum_by = 'goal', quiet = FALSE) %>%
dplyr::rename(Value = Freq)

plot_sdg_bar(data)

from sdgdetector.

caimeng2 avatar caimeng2 commented on August 31, 2024 1

@Yingjie4Science it works for me fine.
Screenshot 2023-05-24 at 2 16 10 PM

installed from Github

from sdgdetector.

v-gestern avatar v-gestern commented on August 31, 2024

@Yingjie4Science Thank you for the update. I re-installed the package and tried to use the new function, but I got this error message: "Error in summarize_sdg(d, sum_by = "goal", quiet = FALSE) :
could not find function "summarize_sdg" even though summarize_sdg is available in the package Help/Description

Bildschirmfoto vom 2023-05-22 17-48-11

from sdgdetector.

Yingjie4Science avatar Yingjie4Science commented on August 31, 2024

@v-gestern did you re-installed via cran or GitHub version? You may want to use the GitHub development version because getting the updated version on CRAN would take a while.

from sdgdetector.

v-gestern avatar v-gestern commented on August 31, 2024

@Yingjie4Science I used the code you are suggesting in your README.md

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

remotes::install_github("Yingjie4Science/SDGdetector")

from sdgdetector.

Yingjie4Science avatar Yingjie4Science commented on August 31, 2024

@v-gestern could you test it again? I found a testing error, and guess that could be the reason that caused the error. I have fixed it and tested it on my end. Hope the updated one can work on your machine.

from sdgdetector.

v-gestern avatar v-gestern commented on August 31, 2024

@Yingjie4Science, thanks a lot for investigating on this issue. I re-installed the package and tried to run the code again. Unfortunately, the error still exists..
Bildschirmfoto vom 2023-05-23 16-44-55

from sdgdetector.

Yingjie4Science avatar Yingjie4Science commented on August 31, 2024

@v-gestern this is interesting... how about removing the package first and re-install it? I just tested this on my machine and there is no error. But I will ask someone else to take a second look/test. Sorry for the inconvenience

remove.packages("SDGdetector")

from sdgdetector.

v-gestern avatar v-gestern commented on August 31, 2024

@Yingjie4Science i removed the package first and then re-installed it. I've tried it again with remove.package() but the error still occurs.

Thank you for investigating :)

from sdgdetector.

Yingjie4Science avatar Yingjie4Science commented on August 31, 2024

@v-gestern An alternative way is to copy everything here and paste it into your code chunk and use the function directly.

Hi @caimeng2 , could you take a look and help address the error? Thanks!

from sdgdetector.

Yingjie4Science avatar Yingjie4Science commented on August 31, 2024

@v-gestern you may try CRAN version and see if it works or not. Otherwise, see the way above.

from sdgdetector.

Yingjie4Science avatar Yingjie4Science commented on August 31, 2024

@caimeng2 Thanks!!! @v-gestern see the above messages, we have updated the CRAN version.

from sdgdetector.

Related Issues (5)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.