Note that there are some explanatory texts on larger screens.

plurals
  1. POIntegration of R Language with php to take the result from R
    text
    copied!<p>I have the following R script</p> <pre><code> #assign data path data_path &lt;- "C:\\Users\\Owner\\Desktop\\R\\work"; #assign valus to the following three percent train_per &lt;- 0.7; test_per &lt;- 0.2; val_per &lt;- 0.1; data &lt;- read.csv(file=paste(data_path,"\\test.csv",sep=""), sep=","); train_d &lt;- sort(sample(nrow(data), nrow(data)*train_per)); train &lt;- data[train_d,]; rem_train &lt;- data[-train_d,]; test_d &lt;- sort(sample(nrow(rem_train), nrow(data)*test_per)); test &lt;- rem_train[test_d,]; validation &lt;- rem_train[-test_d,]; m &lt;- glm(der_var4~.,data=train,family=binomial()); coef_data &lt;- data.frame(coef(m)); coef_data[7:8,"column_name"] &lt;- NA; coef_data$column_name &lt;- row.names(coef_data); write.table(coef_data,file=paste(data_path,"\\coef_data.csv",sep=""),sep=",",row.names=FALSE); anova_data &lt;- data.frame(anova(m)); anova_data[7:8,"column_name"] &lt;- NA; anova_data$column_name &lt;- row.names(anova_data); write.table(anova_data,file=paste(data_path,"\\anova_data.csv",sep=""),sep=",",row.names=FALSE); </code></pre> <p>The above script is running fine in R.The above script will create two csv files. But i want to run that script by using my php code .My main goal is to take the values of the following variables from the php</p> <pre><code>train_per ; test_per ; val_per ; </code></pre> <p>and then i have to send the values of above to R script and then i have to run that script from my php code.Please help me i am new to R as well as php.I am trying to use exec function but not reaching anywhere and i have also seen older posts and also surf the net but could not find any solution. </p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload