Integration with Other Languages
RCall
using CSV, DataFrames, RCall
data1 = CSV.read("../data/machine1.csv",DataFrame,header=false)[:,1];
data2 = CSV.read("../data/machine2.csv",DataFrame,header=false)[:,1];
data3 = CSV.read("../data/machine3.csv",DataFrame,header=false)[:,1];
function R_ANOVA(allData)
data = vcat([[x fill(i, length(x))] for (i,x) in
enumerate(allData)]...)
df = DataFrame(data, [:Diameter, :MachNo])
# @show df
@rput df
R"""
df$MachNo <- as.factor(df$MachNo)
anova <- summary(aov(Diameter ~ MachNo, data=df))
fVal <- anova[[1]]["F value"][[1]][1]
pVal <- anova[[1]]["Pr(>F)"][[1]][1]
"""
println("R ANOVA f-value: ", @rget fVal)
println("R ANOVA p-value: ", @rget pVal)
end
R_ANOVA([data1, data2, data3])
PyCall
using PyCall
TB = pyimport("textblob")
str = """Some people think that Star Wars The Last Jedi is an excellent movie, with perfect, flawless storytelling and impeccable acting. Others think that it was an average movie, with a simple storyline and basic acting. However, the reality is almost everyone felt anger and disappointment with its forced acting and bad storytelling."""
blob = TB.TextBlob(str)
[ i.sentiment for i in blob.sentences]
```