Tue May 24, 2022 8:57 pm
Login Register Lost Password? Contact Us

Using R packages in embedded codes

Questions and comments related to the rHPCC integration plugin

Fri Oct 30, 2015 4:46 am Change Time Zone


I was trying out external language support feature in R. I needed to call some functions in 'sentiment' package,for that i tried the below code

Code: Select all
dataset(out_Layout)  sent_analysis(dataset(Message_Layout) old_file) :=  EMBED(R)

     out = old_file
     txt = gsub("(RT|via)((?:\\b\\W*@\\w+)+)", "", txt)
     txt = gsub("@\\w+", "", txt)
     txt = gsub("[[:punct:]]", "", txt)
     txt = gsub("[[:digit:]]", "", txt)
     txt = gsub("http\\w+", "", txt)
     txt = txt[!is.na(txt)]
     names(txt) = NULL
     txt_class_pol = classify_polarity(txt, algorithm="Bayes")

Here i am getting evaluation error while running


Rest of the code works properly,without this function call.

Can anyone tell,how can we include libraries in embedded R code. Is it necessary to explicitly install the required packages before using it?If so,how should i do it?
Posts: 20
Joined: Wed Feb 25, 2015 11:52 am

Mon Nov 09, 2015 1:22 pm Change Time Zone

I'm not really an expert on the use of R, but yes, you will need to use the standard R mechanisms to install R libraries on the cluster nodes.

Community Advisory Board Member
Community Advisory Board Member
Posts: 110
Joined: Fri Jun 17, 2011 8:59 am

Return to R Plugin

Who is online

Users browsing this forum: No registered users and 1 guest