plumber

Sending json file in curl and receiving it in R using plumber

和自甴很熟 提交于 2019-12-02 11:14:26
问题 I need to send a json file with multiple values and receive it in R using plumber, ive tried this but it doesnt seem to work, library("rjson") #install.packages("rjson") #* @get /predict #* @post /predict function(predict) { # Load the package required to read JSON files. library("rjson") # Give the input file name to the function. result <- fromJSON(file = "input_v3.json") print(result) result <- as.data.frame(result) write.table(result, file="testing_v3_xyz.csv", sep=",", row.names=FALSE,

Get file through API call (R & plumber)

二次信任 提交于 2019-12-01 20:43:33
问题 I'm using plumber as a simple web-api service for some R functions. I would like to provide a file 'download' (on the client side) through an R function very much like flask is doing it in python through send_file and send_from_directory. I tried #* @get /datafile get_file <- function(){ return(file('path-to-file.RData')) } But unfortunately it didn't work (because the return value cannot be transformed to JSON). I'm aware of static file server option in plubmer, but I really want to provide

Get file through API call (R & plumber)

送分小仙女□ 提交于 2019-12-01 18:29:36
I'm using plumber as a simple web-api service for some R functions. I would like to provide a file 'download' (on the client side) through an R function very much like flask is doing it in python through send_file and send_from_directory . I tried #* @get /datafile get_file <- function(){ return(file('path-to-file.RData')) } But unfortunately it didn't work (because the return value cannot be transformed to JSON). I'm aware of static file server option in plubmer , but I really want to provide only one single file and not a directory. (Although serving files in directory through @assets seems

Building RESTful API using R

我与影子孤独终老i 提交于 2019-11-28 17:30:55
I am thinking about building a RESTful API using the programming language R , mainly to expose my machine learning model to the user in an API format. I know there are some options like export to PMML, PFA and use other languages to take care of the API part. However, I want to stick to the same programming language and was wondering if there is anything like Flask/Django/Springbook framework in R? I took a look at servr / shiny but I really don't think RESTful is what they are designed for. Is there any better solution within R that is more easy to use? I have two options for you: plumber

Building RESTful API using R

不羁岁月 提交于 2019-11-27 10:33:09
问题 I am thinking about building a RESTful API using the programming language R , mainly to expose my machine learning model to the user in an API format. I know there are some options like export to PMML, PFA and use other languages to take care of the API part. However, I want to stick to the same programming language and was wondering if there is anything like Flask/Django/Springbook framework in R? I took a look at servr/shiny but I really don't think RESTful is what they are designed for. Is