passing value from searchTwitter with textInput value to get_nrc_sentiment










0














I am planning to do a online Twitter sentiment analyzer that user can enter the search term by themselves using flexdashboard. Here is the code.



#Getting search term
textInput("data", label = "Enter search term", value = "", width = NULL, placeholder = NULL)
sliderInput("maxTweets", "Number of recent tweets to use for analysis:", min = 10, max = 1000, value = 500)
actionButton("enter", label = "Enter")

twt <- reactive(
if(input$enter!=0)
isolate(
twt <- searchTwitter(input$data, n=input$maxTweets, lang = "en", resultType = "recent")
)

)

#print tweets searched
twt


Here is the problem. When I run the code below, an error occurred "Error in get_nrc_sentiment: Data must be a character vector.". I have tried map_chr and as.character before but I don't have the column to select.



#Get sentiment 
s <- reactive(
s<- get_nrc_sentiment(twt())
)

#Print output
s









share|improve this question





















  • You're passing a data.frame or list to get_nrc_sentiment, instead of just the column of text. Try, twt()$text is it's a data frame.
    – JohnCoene
    Nov 10 '18 at 10:40











  • It returns the same error when I tried s <- get_nrc_sentiment(twt()$text)
    – Janegoh95
    Nov 11 '18 at 4:17











  • The searchTwitter function is from the deprecated twitteR package which returned a list, there is a function of that package called twListToDF which you must run to turn the results into a data.frame. however I would strongly advise using the rtweet package instead.
    – JohnCoene
    Nov 11 '18 at 11:39










  • Although I changed my code to twt <- reactive( if(input$enter!=0) isolate( twt <- search_tweets(input$data, n=input$maxTweets, lang = "en", resultType = "recent", include_rts = FALSE) ) ) the 's <- reactive( s<- get_nrc_sentiment(twt()$text) )` still return "Error in get_nrc_sentiment: Data must be a character vector.". I think this is caused by the self input or reactive function because when I ran the srch <- search_tweets("#rstats", n = 1000) it works perfectly fine.
    – Janegoh95
    Nov 12 '18 at 13:39
















0














I am planning to do a online Twitter sentiment analyzer that user can enter the search term by themselves using flexdashboard. Here is the code.



#Getting search term
textInput("data", label = "Enter search term", value = "", width = NULL, placeholder = NULL)
sliderInput("maxTweets", "Number of recent tweets to use for analysis:", min = 10, max = 1000, value = 500)
actionButton("enter", label = "Enter")

twt <- reactive(
if(input$enter!=0)
isolate(
twt <- searchTwitter(input$data, n=input$maxTweets, lang = "en", resultType = "recent")
)

)

#print tweets searched
twt


Here is the problem. When I run the code below, an error occurred "Error in get_nrc_sentiment: Data must be a character vector.". I have tried map_chr and as.character before but I don't have the column to select.



#Get sentiment 
s <- reactive(
s<- get_nrc_sentiment(twt())
)

#Print output
s









share|improve this question





















  • You're passing a data.frame or list to get_nrc_sentiment, instead of just the column of text. Try, twt()$text is it's a data frame.
    – JohnCoene
    Nov 10 '18 at 10:40











  • It returns the same error when I tried s <- get_nrc_sentiment(twt()$text)
    – Janegoh95
    Nov 11 '18 at 4:17











  • The searchTwitter function is from the deprecated twitteR package which returned a list, there is a function of that package called twListToDF which you must run to turn the results into a data.frame. however I would strongly advise using the rtweet package instead.
    – JohnCoene
    Nov 11 '18 at 11:39










  • Although I changed my code to twt <- reactive( if(input$enter!=0) isolate( twt <- search_tweets(input$data, n=input$maxTweets, lang = "en", resultType = "recent", include_rts = FALSE) ) ) the 's <- reactive( s<- get_nrc_sentiment(twt()$text) )` still return "Error in get_nrc_sentiment: Data must be a character vector.". I think this is caused by the self input or reactive function because when I ran the srch <- search_tweets("#rstats", n = 1000) it works perfectly fine.
    – Janegoh95
    Nov 12 '18 at 13:39














0












0








0







I am planning to do a online Twitter sentiment analyzer that user can enter the search term by themselves using flexdashboard. Here is the code.



#Getting search term
textInput("data", label = "Enter search term", value = "", width = NULL, placeholder = NULL)
sliderInput("maxTweets", "Number of recent tweets to use for analysis:", min = 10, max = 1000, value = 500)
actionButton("enter", label = "Enter")

twt <- reactive(
if(input$enter!=0)
isolate(
twt <- searchTwitter(input$data, n=input$maxTweets, lang = "en", resultType = "recent")
)

)

#print tweets searched
twt


Here is the problem. When I run the code below, an error occurred "Error in get_nrc_sentiment: Data must be a character vector.". I have tried map_chr and as.character before but I don't have the column to select.



#Get sentiment 
s <- reactive(
s<- get_nrc_sentiment(twt())
)

#Print output
s









share|improve this question













I am planning to do a online Twitter sentiment analyzer that user can enter the search term by themselves using flexdashboard. Here is the code.



#Getting search term
textInput("data", label = "Enter search term", value = "", width = NULL, placeholder = NULL)
sliderInput("maxTweets", "Number of recent tweets to use for analysis:", min = 10, max = 1000, value = 500)
actionButton("enter", label = "Enter")

twt <- reactive(
if(input$enter!=0)
isolate(
twt <- searchTwitter(input$data, n=input$maxTweets, lang = "en", resultType = "recent")
)

)

#print tweets searched
twt


Here is the problem. When I run the code below, an error occurred "Error in get_nrc_sentiment: Data must be a character vector.". I have tried map_chr and as.character before but I don't have the column to select.



#Get sentiment 
s <- reactive(
s<- get_nrc_sentiment(twt())
)

#Print output
s






r shiny r-markdown






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Nov 10 '18 at 7:46









Janegoh95

11




11











  • You're passing a data.frame or list to get_nrc_sentiment, instead of just the column of text. Try, twt()$text is it's a data frame.
    – JohnCoene
    Nov 10 '18 at 10:40











  • It returns the same error when I tried s <- get_nrc_sentiment(twt()$text)
    – Janegoh95
    Nov 11 '18 at 4:17











  • The searchTwitter function is from the deprecated twitteR package which returned a list, there is a function of that package called twListToDF which you must run to turn the results into a data.frame. however I would strongly advise using the rtweet package instead.
    – JohnCoene
    Nov 11 '18 at 11:39










  • Although I changed my code to twt <- reactive( if(input$enter!=0) isolate( twt <- search_tweets(input$data, n=input$maxTweets, lang = "en", resultType = "recent", include_rts = FALSE) ) ) the 's <- reactive( s<- get_nrc_sentiment(twt()$text) )` still return "Error in get_nrc_sentiment: Data must be a character vector.". I think this is caused by the self input or reactive function because when I ran the srch <- search_tweets("#rstats", n = 1000) it works perfectly fine.
    – Janegoh95
    Nov 12 '18 at 13:39

















  • You're passing a data.frame or list to get_nrc_sentiment, instead of just the column of text. Try, twt()$text is it's a data frame.
    – JohnCoene
    Nov 10 '18 at 10:40











  • It returns the same error when I tried s <- get_nrc_sentiment(twt()$text)
    – Janegoh95
    Nov 11 '18 at 4:17











  • The searchTwitter function is from the deprecated twitteR package which returned a list, there is a function of that package called twListToDF which you must run to turn the results into a data.frame. however I would strongly advise using the rtweet package instead.
    – JohnCoene
    Nov 11 '18 at 11:39










  • Although I changed my code to twt <- reactive( if(input$enter!=0) isolate( twt <- search_tweets(input$data, n=input$maxTweets, lang = "en", resultType = "recent", include_rts = FALSE) ) ) the 's <- reactive( s<- get_nrc_sentiment(twt()$text) )` still return "Error in get_nrc_sentiment: Data must be a character vector.". I think this is caused by the self input or reactive function because when I ran the srch <- search_tweets("#rstats", n = 1000) it works perfectly fine.
    – Janegoh95
    Nov 12 '18 at 13:39
















You're passing a data.frame or list to get_nrc_sentiment, instead of just the column of text. Try, twt()$text is it's a data frame.
– JohnCoene
Nov 10 '18 at 10:40





You're passing a data.frame or list to get_nrc_sentiment, instead of just the column of text. Try, twt()$text is it's a data frame.
– JohnCoene
Nov 10 '18 at 10:40













It returns the same error when I tried s <- get_nrc_sentiment(twt()$text)
– Janegoh95
Nov 11 '18 at 4:17





It returns the same error when I tried s <- get_nrc_sentiment(twt()$text)
– Janegoh95
Nov 11 '18 at 4:17













The searchTwitter function is from the deprecated twitteR package which returned a list, there is a function of that package called twListToDF which you must run to turn the results into a data.frame. however I would strongly advise using the rtweet package instead.
– JohnCoene
Nov 11 '18 at 11:39




The searchTwitter function is from the deprecated twitteR package which returned a list, there is a function of that package called twListToDF which you must run to turn the results into a data.frame. however I would strongly advise using the rtweet package instead.
– JohnCoene
Nov 11 '18 at 11:39












Although I changed my code to twt <- reactive( if(input$enter!=0) isolate( twt <- search_tweets(input$data, n=input$maxTweets, lang = "en", resultType = "recent", include_rts = FALSE) ) ) the 's <- reactive( s<- get_nrc_sentiment(twt()$text) )` still return "Error in get_nrc_sentiment: Data must be a character vector.". I think this is caused by the self input or reactive function because when I ran the srch <- search_tweets("#rstats", n = 1000) it works perfectly fine.
– Janegoh95
Nov 12 '18 at 13:39





Although I changed my code to twt <- reactive( if(input$enter!=0) isolate( twt <- search_tweets(input$data, n=input$maxTweets, lang = "en", resultType = "recent", include_rts = FALSE) ) ) the 's <- reactive( s<- get_nrc_sentiment(twt()$text) )` still return "Error in get_nrc_sentiment: Data must be a character vector.". I think this is caused by the self input or reactive function because when I ran the srch <- search_tweets("#rstats", n = 1000) it works perfectly fine.
– Janegoh95
Nov 12 '18 at 13:39













2 Answers
2






active

oldest

votes


















0














As mentioned in my comment I would strongly advise moving to rtweet, as stated on the twitteR Github page:




This is the start of a relatively leisurely deprecation period for twitteR, in favor of using rtweet. Please start looking to switch over to that package. If you have any questions contact myself or @mkearney




The last commit on that repository was 2 years ago.



If you want to use twitteR nonetheless.



twt <- searchTwitter(input$data, n=100, lang = "en", resultType = "recent")
twt <- twiListToDF(twt) # turn data.frame into a list
twt$text <- as.character(twt$text) # ensure it's a character vector

class(twt)
class(twt$text)

syuzhet::get_nrc_sentiment(txt$text)


You had to make sure it was 1) a vector 2) of type character



syuzhet::get_nrc_sentiment(as.factor(c("Hello", "World")))
#> Error in syuzhet::get_nrc_sentiment(as.factor(c("Hello", "World"))) :
Data must be a character vector.
syuzhet::get_nrc_sentiment(list("Hello", "World"))
#> Error in syuzhet::get_nrc_sentiment(list("Hello", "World")) :
Data must be a character vector.





share|improve this answer






















  • rtweet returns a data.frame where text if of class character
    – JohnCoene
    Nov 13 '18 at 12:59










  • Sorry to bother again. I have no idea why I use the rtweet in twt <- reactive( if(input$enter!=0) isolate( twt <- search_tweets(input$data, n=100, lang = "en", include_rts = FALSE) ) ) the s <- reactive( s<- get_nrc_sentiment(twt()) ) still shows error with "Error in get_nrc_sentiment: Data must be a character vector."
    – Janegoh95
    Nov 14 '18 at 15:43











  • You are using runtime: shiny correct? doc - reactive functions will not work otherwise.
    – JohnCoene
    Nov 14 '18 at 15:46











  • Yes. Is that means there is no possible to do a self input function? Because now I am creating a sentiment analysis engine with self input function.
    – Janegoh95
    Nov 14 '18 at 16:38






  • 1




    Alright. Thank you very much @JohnCoene
    – Janegoh95
    Nov 16 '18 at 16:51


















0














This is my answer.



```r
#Getting search term
textInput("data", label = "Enter search term", value = "")
actionButton("enter", label = "Enter")

twt <- reactive(
if(input$enter!=0)
isolate(
return(search_tweets(input$data, n=100, lang = "en", include_rts = FALSE))
)

)
```

````r
#Get sentiment score of tweets
s <- reactive(
return(get_nrc_sentiment(twt()$text))
)
#Print sentiment score
renderTable(head(s()))
```





share|improve this answer




















    Your Answer






    StackExchange.ifUsing("editor", function ()
    StackExchange.using("externalEditor", function ()
    StackExchange.using("snippets", function ()
    StackExchange.snippets.init();
    );
    );
    , "code-snippets");

    StackExchange.ready(function()
    var channelOptions =
    tags: "".split(" "),
    id: "1"
    ;
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function()
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled)
    StackExchange.using("snippets", function()
    createEditor();
    );

    else
    createEditor();

    );

    function createEditor()
    StackExchange.prepareEditor(
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader:
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    ,
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    );



    );













    draft saved

    draft discarded


















    StackExchange.ready(
    function ()
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53237012%2fpassing-value-from-searchtwitter-with-textinput-value-to-get-nrc-sentiment%23new-answer', 'question_page');

    );

    Post as a guest















    Required, but never shown

























    2 Answers
    2






    active

    oldest

    votes








    2 Answers
    2






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    0














    As mentioned in my comment I would strongly advise moving to rtweet, as stated on the twitteR Github page:




    This is the start of a relatively leisurely deprecation period for twitteR, in favor of using rtweet. Please start looking to switch over to that package. If you have any questions contact myself or @mkearney




    The last commit on that repository was 2 years ago.



    If you want to use twitteR nonetheless.



    twt <- searchTwitter(input$data, n=100, lang = "en", resultType = "recent")
    twt <- twiListToDF(twt) # turn data.frame into a list
    twt$text <- as.character(twt$text) # ensure it's a character vector

    class(twt)
    class(twt$text)

    syuzhet::get_nrc_sentiment(txt$text)


    You had to make sure it was 1) a vector 2) of type character



    syuzhet::get_nrc_sentiment(as.factor(c("Hello", "World")))
    #> Error in syuzhet::get_nrc_sentiment(as.factor(c("Hello", "World"))) :
    Data must be a character vector.
    syuzhet::get_nrc_sentiment(list("Hello", "World"))
    #> Error in syuzhet::get_nrc_sentiment(list("Hello", "World")) :
    Data must be a character vector.





    share|improve this answer






















    • rtweet returns a data.frame where text if of class character
      – JohnCoene
      Nov 13 '18 at 12:59










    • Sorry to bother again. I have no idea why I use the rtweet in twt <- reactive( if(input$enter!=0) isolate( twt <- search_tweets(input$data, n=100, lang = "en", include_rts = FALSE) ) ) the s <- reactive( s<- get_nrc_sentiment(twt()) ) still shows error with "Error in get_nrc_sentiment: Data must be a character vector."
      – Janegoh95
      Nov 14 '18 at 15:43











    • You are using runtime: shiny correct? doc - reactive functions will not work otherwise.
      – JohnCoene
      Nov 14 '18 at 15:46











    • Yes. Is that means there is no possible to do a self input function? Because now I am creating a sentiment analysis engine with self input function.
      – Janegoh95
      Nov 14 '18 at 16:38






    • 1




      Alright. Thank you very much @JohnCoene
      – Janegoh95
      Nov 16 '18 at 16:51















    0














    As mentioned in my comment I would strongly advise moving to rtweet, as stated on the twitteR Github page:




    This is the start of a relatively leisurely deprecation period for twitteR, in favor of using rtweet. Please start looking to switch over to that package. If you have any questions contact myself or @mkearney




    The last commit on that repository was 2 years ago.



    If you want to use twitteR nonetheless.



    twt <- searchTwitter(input$data, n=100, lang = "en", resultType = "recent")
    twt <- twiListToDF(twt) # turn data.frame into a list
    twt$text <- as.character(twt$text) # ensure it's a character vector

    class(twt)
    class(twt$text)

    syuzhet::get_nrc_sentiment(txt$text)


    You had to make sure it was 1) a vector 2) of type character



    syuzhet::get_nrc_sentiment(as.factor(c("Hello", "World")))
    #> Error in syuzhet::get_nrc_sentiment(as.factor(c("Hello", "World"))) :
    Data must be a character vector.
    syuzhet::get_nrc_sentiment(list("Hello", "World"))
    #> Error in syuzhet::get_nrc_sentiment(list("Hello", "World")) :
    Data must be a character vector.





    share|improve this answer






















    • rtweet returns a data.frame where text if of class character
      – JohnCoene
      Nov 13 '18 at 12:59










    • Sorry to bother again. I have no idea why I use the rtweet in twt <- reactive( if(input$enter!=0) isolate( twt <- search_tweets(input$data, n=100, lang = "en", include_rts = FALSE) ) ) the s <- reactive( s<- get_nrc_sentiment(twt()) ) still shows error with "Error in get_nrc_sentiment: Data must be a character vector."
      – Janegoh95
      Nov 14 '18 at 15:43











    • You are using runtime: shiny correct? doc - reactive functions will not work otherwise.
      – JohnCoene
      Nov 14 '18 at 15:46











    • Yes. Is that means there is no possible to do a self input function? Because now I am creating a sentiment analysis engine with self input function.
      – Janegoh95
      Nov 14 '18 at 16:38






    • 1




      Alright. Thank you very much @JohnCoene
      – Janegoh95
      Nov 16 '18 at 16:51













    0












    0








    0






    As mentioned in my comment I would strongly advise moving to rtweet, as stated on the twitteR Github page:




    This is the start of a relatively leisurely deprecation period for twitteR, in favor of using rtweet. Please start looking to switch over to that package. If you have any questions contact myself or @mkearney




    The last commit on that repository was 2 years ago.



    If you want to use twitteR nonetheless.



    twt <- searchTwitter(input$data, n=100, lang = "en", resultType = "recent")
    twt <- twiListToDF(twt) # turn data.frame into a list
    twt$text <- as.character(twt$text) # ensure it's a character vector

    class(twt)
    class(twt$text)

    syuzhet::get_nrc_sentiment(txt$text)


    You had to make sure it was 1) a vector 2) of type character



    syuzhet::get_nrc_sentiment(as.factor(c("Hello", "World")))
    #> Error in syuzhet::get_nrc_sentiment(as.factor(c("Hello", "World"))) :
    Data must be a character vector.
    syuzhet::get_nrc_sentiment(list("Hello", "World"))
    #> Error in syuzhet::get_nrc_sentiment(list("Hello", "World")) :
    Data must be a character vector.





    share|improve this answer














    As mentioned in my comment I would strongly advise moving to rtweet, as stated on the twitteR Github page:




    This is the start of a relatively leisurely deprecation period for twitteR, in favor of using rtweet. Please start looking to switch over to that package. If you have any questions contact myself or @mkearney




    The last commit on that repository was 2 years ago.



    If you want to use twitteR nonetheless.



    twt <- searchTwitter(input$data, n=100, lang = "en", resultType = "recent")
    twt <- twiListToDF(twt) # turn data.frame into a list
    twt$text <- as.character(twt$text) # ensure it's a character vector

    class(twt)
    class(twt$text)

    syuzhet::get_nrc_sentiment(txt$text)


    You had to make sure it was 1) a vector 2) of type character



    syuzhet::get_nrc_sentiment(as.factor(c("Hello", "World")))
    #> Error in syuzhet::get_nrc_sentiment(as.factor(c("Hello", "World"))) :
    Data must be a character vector.
    syuzhet::get_nrc_sentiment(list("Hello", "World"))
    #> Error in syuzhet::get_nrc_sentiment(list("Hello", "World")) :
    Data must be a character vector.






    share|improve this answer














    share|improve this answer



    share|improve this answer








    edited Nov 13 '18 at 23:10

























    answered Nov 13 '18 at 12:58









    JohnCoene

    890615




    890615











    • rtweet returns a data.frame where text if of class character
      – JohnCoene
      Nov 13 '18 at 12:59










    • Sorry to bother again. I have no idea why I use the rtweet in twt <- reactive( if(input$enter!=0) isolate( twt <- search_tweets(input$data, n=100, lang = "en", include_rts = FALSE) ) ) the s <- reactive( s<- get_nrc_sentiment(twt()) ) still shows error with "Error in get_nrc_sentiment: Data must be a character vector."
      – Janegoh95
      Nov 14 '18 at 15:43











    • You are using runtime: shiny correct? doc - reactive functions will not work otherwise.
      – JohnCoene
      Nov 14 '18 at 15:46











    • Yes. Is that means there is no possible to do a self input function? Because now I am creating a sentiment analysis engine with self input function.
      – Janegoh95
      Nov 14 '18 at 16:38






    • 1




      Alright. Thank you very much @JohnCoene
      – Janegoh95
      Nov 16 '18 at 16:51
















    • rtweet returns a data.frame where text if of class character
      – JohnCoene
      Nov 13 '18 at 12:59










    • Sorry to bother again. I have no idea why I use the rtweet in twt <- reactive( if(input$enter!=0) isolate( twt <- search_tweets(input$data, n=100, lang = "en", include_rts = FALSE) ) ) the s <- reactive( s<- get_nrc_sentiment(twt()) ) still shows error with "Error in get_nrc_sentiment: Data must be a character vector."
      – Janegoh95
      Nov 14 '18 at 15:43











    • You are using runtime: shiny correct? doc - reactive functions will not work otherwise.
      – JohnCoene
      Nov 14 '18 at 15:46











    • Yes. Is that means there is no possible to do a self input function? Because now I am creating a sentiment analysis engine with self input function.
      – Janegoh95
      Nov 14 '18 at 16:38






    • 1




      Alright. Thank you very much @JohnCoene
      – Janegoh95
      Nov 16 '18 at 16:51















    rtweet returns a data.frame where text if of class character
    – JohnCoene
    Nov 13 '18 at 12:59




    rtweet returns a data.frame where text if of class character
    – JohnCoene
    Nov 13 '18 at 12:59












    Sorry to bother again. I have no idea why I use the rtweet in twt <- reactive( if(input$enter!=0) isolate( twt <- search_tweets(input$data, n=100, lang = "en", include_rts = FALSE) ) ) the s <- reactive( s<- get_nrc_sentiment(twt()) ) still shows error with "Error in get_nrc_sentiment: Data must be a character vector."
    – Janegoh95
    Nov 14 '18 at 15:43





    Sorry to bother again. I have no idea why I use the rtweet in twt <- reactive( if(input$enter!=0) isolate( twt <- search_tweets(input$data, n=100, lang = "en", include_rts = FALSE) ) ) the s <- reactive( s<- get_nrc_sentiment(twt()) ) still shows error with "Error in get_nrc_sentiment: Data must be a character vector."
    – Janegoh95
    Nov 14 '18 at 15:43













    You are using runtime: shiny correct? doc - reactive functions will not work otherwise.
    – JohnCoene
    Nov 14 '18 at 15:46





    You are using runtime: shiny correct? doc - reactive functions will not work otherwise.
    – JohnCoene
    Nov 14 '18 at 15:46













    Yes. Is that means there is no possible to do a self input function? Because now I am creating a sentiment analysis engine with self input function.
    – Janegoh95
    Nov 14 '18 at 16:38




    Yes. Is that means there is no possible to do a self input function? Because now I am creating a sentiment analysis engine with self input function.
    – Janegoh95
    Nov 14 '18 at 16:38




    1




    1




    Alright. Thank you very much @JohnCoene
    – Janegoh95
    Nov 16 '18 at 16:51




    Alright. Thank you very much @JohnCoene
    – Janegoh95
    Nov 16 '18 at 16:51













    0














    This is my answer.



    ```r
    #Getting search term
    textInput("data", label = "Enter search term", value = "")
    actionButton("enter", label = "Enter")

    twt <- reactive(
    if(input$enter!=0)
    isolate(
    return(search_tweets(input$data, n=100, lang = "en", include_rts = FALSE))
    )

    )
    ```

    ````r
    #Get sentiment score of tweets
    s <- reactive(
    return(get_nrc_sentiment(twt()$text))
    )
    #Print sentiment score
    renderTable(head(s()))
    ```





    share|improve this answer

























      0














      This is my answer.



      ```r
      #Getting search term
      textInput("data", label = "Enter search term", value = "")
      actionButton("enter", label = "Enter")

      twt <- reactive(
      if(input$enter!=0)
      isolate(
      return(search_tweets(input$data, n=100, lang = "en", include_rts = FALSE))
      )

      )
      ```

      ````r
      #Get sentiment score of tweets
      s <- reactive(
      return(get_nrc_sentiment(twt()$text))
      )
      #Print sentiment score
      renderTable(head(s()))
      ```





      share|improve this answer























        0












        0








        0






        This is my answer.



        ```r
        #Getting search term
        textInput("data", label = "Enter search term", value = "")
        actionButton("enter", label = "Enter")

        twt <- reactive(
        if(input$enter!=0)
        isolate(
        return(search_tweets(input$data, n=100, lang = "en", include_rts = FALSE))
        )

        )
        ```

        ````r
        #Get sentiment score of tweets
        s <- reactive(
        return(get_nrc_sentiment(twt()$text))
        )
        #Print sentiment score
        renderTable(head(s()))
        ```





        share|improve this answer












        This is my answer.



        ```r
        #Getting search term
        textInput("data", label = "Enter search term", value = "")
        actionButton("enter", label = "Enter")

        twt <- reactive(
        if(input$enter!=0)
        isolate(
        return(search_tweets(input$data, n=100, lang = "en", include_rts = FALSE))
        )

        )
        ```

        ````r
        #Get sentiment score of tweets
        s <- reactive(
        return(get_nrc_sentiment(twt()$text))
        )
        #Print sentiment score
        renderTable(head(s()))
        ```






        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Nov 16 '18 at 17:07









        Janegoh95

        11




        11



























            draft saved

            draft discarded
















































            Thanks for contributing an answer to Stack Overflow!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid


            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.

            To learn more, see our tips on writing great answers.





            Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


            Please pay close attention to the following guidance:


            • Please be sure to answer the question. Provide details and share your research!

            But avoid


            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.

            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53237012%2fpassing-value-from-searchtwitter-with-textinput-value-to-get-nrc-sentiment%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            𛂒𛀶,𛀽𛀑𛂀𛃧𛂓𛀙𛃆𛃑𛃷𛂟𛁡𛀢𛀟𛁤𛂽𛁕𛁪𛂟𛂯,𛁞𛂧𛀴𛁄𛁠𛁼𛂿𛀤 𛂘,𛁺𛂾𛃭𛃭𛃵𛀺,𛂣𛃍𛂖𛃶 𛀸𛃀𛂖𛁶𛁏𛁚 𛂢𛂞 𛁰𛂆𛀔,𛁸𛀽𛁓𛃋𛂇𛃧𛀧𛃣𛂐𛃇,𛂂𛃻𛃲𛁬𛃞𛀧𛃃𛀅 𛂭𛁠𛁡𛃇𛀷𛃓𛁥,𛁙𛁘𛁞𛃸𛁸𛃣𛁜,𛂛,𛃿,𛁯𛂘𛂌𛃛𛁱𛃌𛂈𛂇 𛁊𛃲,𛀕𛃴𛀜 𛀶𛂆𛀶𛃟𛂉𛀣,𛂐𛁞𛁾 𛁷𛂑𛁳𛂯𛀬𛃅,𛃶𛁼

            Edmonton

            Crossroads (UK TV series)