Because in PHP Web pages, it is unavoidable to need the powerful function of R language. Therefore, in the implementation of some mathematical functions, we need to implement the R language. The method is to use the PHP system function to invoke R script, so that the operation of R script, through the PHP file operation, so as to get R script execution results. The basic code is as follows:
System ("F:\R\R-3.2.3\bin\R.exe--vanilla
< pre="">
Because it is implemented by the Windows platform, you can use the system () implementation in PHP as long as the script commands are guaranteed to run in the CMD console.
Precautions:
(1). Ensure that no Chinese characters and spaces are in the path of the system
(2). To configure the R locale in advance, add the path F:\R\R-3.2.3\bin in path
The above describes the PHP call R script implementation, including the aspects of the content, I hope to be interested in PHP tutorial friends helpful.