Comments (12)
@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.
@Yingjie4Science it works for me fine.
installed from Github
from sdgdetector.
@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
from sdgdetector.
@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.
@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.
@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.
@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..
from sdgdetector.
@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.
@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.
@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.
@v-gestern you may try CRAN version and see if it works or not. Otherwise, see the way above.
from sdgdetector.
@caimeng2 Thanks!!! @v-gestern see the above messages, we have updated the CRAN version.
from sdgdetector.
Related Issues (5)
- add `How to cite` and enable `citation()` HOT 1
- improvement HOT 3
- JOSS Review HOT 8
- JOSS Review - csaybar HOT 8
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sdgdetector.