Giter VIP home page Giter VIP logo

Comments (6)

kennylee15 avatar kennylee15 commented on September 17, 2024 1

Thanks for everything! I dealt with problems with other chapters last night.

from cc21.

tracy3057 avatar tracy3057 commented on September 17, 2024

Can you remember which rmd file uses this package?

from cc21.

jtr13 avatar jtr13 commented on September 17, 2024

The issue here is that rJava is hard to install on Ubuntu, which is the OS that GitHub Actions is using. That is the reason I didn't include qdap before... sorry I forgot to mention that. I'll try to figure out how to do it. In the meantime, just set the code chunks that use qdap to eval=FALSE and put in a comment in those chunks explaining the issue.

from cc21.

kennylee15 avatar kennylee15 commented on September 17, 2024

Copying my comment from here: 1691bc5

@jtr13 I was trying to figure out what was going with the latest error here.

https://github.com/jtr13/cc21/runs/2198706265?

In particular, this message:

Quitting from lines 145-151 (sentiment_analysis_and_wordcloud.Rmd) 
Error in menu(choices = c("Yes", "No"), title = title) : 
  menu() cannot be used non-interactively
Calls: local ... get_sentiments -> <Anonymous> -> load_dataset -> printer -> menu
Execution halted
Error in Rscript_render(f, render_args, render_meta, add1, add2) : 
  Failed to compile sentiment_analysis_and_wordcloud.Rmd
Calls: <Anonymous> -> render_new_session -> Rscript_render
Execution halted

The problem seems to be line 148. It derives from the fact that this line asks for user input.

See this similar issue on stackoverflow: https://stackoverflow.com/questions/57225210/sentiments-dataset-in-r-throwing-error-with-afinn-lexicon

from cc21.

kennylee15 avatar kennylee15 commented on September 17, 2024

Okay, I tried to replicate it in RStudio. It doesn't run as a rmd file. But I was able to run it as a simple R file.

The problem comes from the fact that in the following code block, this code get_sentiments('nrc') attempts to download a large data file but requires a user confirmation. This requirement for user input probably won't work here.

videogame %>%
  select(id,review) %>%
  unnest_tokens(output = word, input = review) %>%
  inner_join(get_sentiments('nrc')) %>%
  group_by(sentiment) %>%
    count()

I think we should ask the submitter to either leave this part out or load the file in a different way that does not require manual user activity.

from cc21.

jtr13 avatar jtr13 commented on September 17, 2024

Exactly. Since the chapter was already merged I figured it was on us to fix it. I just added a note to the chapter and added eval=FALSE to the the two code chunks that use nrc. Often there's a way around these things but they are very explicit that they don't want to allow non-interactive downloads of the lexicons due to licensing issues: EmilHvitfeldt/textdata#19

I was able (finally) to get rJava to work by adding

          sudo apt install \
            default-jre \
            default-jdk 
          sudo R CMD javareconf  

to the GitHub Actions .yaml file.

Now it's failing due to problems with other chapters.

from cc21.

Related Issues (8)

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.