Closed v-gestern closed 1 year ago
@v-gestern Thanks for spotting the confusing description in the help function. I have revised the description as:
df
plus one extra column named "sdgs", whichsummarize_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.
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)
@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
@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.
@Yingjie4Science I used the code you are suggesting in your README.md
if (!require("remotes")) { install.packages("remotes") }
remotes::install_github("Yingjie4Science/SDGdetector")
@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.
@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..
@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")
@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 :)
@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!
@v-gestern you may try CRAN version and see if it works or not. Otherwise, see the way above.
@Yingjie4Science it works for me fine.
installed from Github
@caimeng2 Thanks!!! @v-gestern see the above messages, we have updated the CRAN version.
Thank you for creating an providing this super cool package!
Unfortunately I can´t perform all given functionalities on my own data. If I run SDGdetector on my data, it returns a df with the the new column "sdg" where the identified SDGs are shown. But it doesn´t return the values described in the help function ("Data frame with the same information as df and 18 extra columns: 17 columns marking the number of occurrence of each of the 17 SDGs and one column match_detail listing details of specific targets.").
And where do I get the "Value" column from to perform plot_sdg_bar on my own data?