This function will post the data from R into PI as JSON format and store it back to R by using CURL natively from the system. CURL will need to be installed and configured properly (specially on Windows) to make sure that the queries run successfully. User will have the capability of encrypting with server (which it is not default). This would have to be enable since the script is configured to be run with Node.js locally.
1 |
1 2 3 4 | new.x1 <- getPI2(url="http://www.example.com", x=data$field, dump=NULL) # store results into new var x2
new.x2 <- getPI2(url="https://www.example.com", x=data$field, dump=NULL, ssl=TRUE) # store results into new var x2, but information is encrypted with server
new.x3 <- getPI2(url="https://www.example.com", x=data$field, dump=NULL, win=TRUE) # store results into new var x3 and using windows
new.x4 <- getPI2(url="https://www.example.com", x=data$field, dump=NULL, win=TRUE, capath="C:/pathtoca/cacert.pem") # store results into new var x4 and using windows
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.