I am new to R. I have to expose the recreation service using R, so I found a plumber to expose the recreation service using R, I successfully executed the plumber in R, but in return I get a json array as shown below
[{"Name": "Rajesh", "age": "10"}]
how to remove an array from the answer above
my expected result looks lower
{"name": "Rajesh", "age": "10"}
The code
library(plumber)
r <- plumb("MyFile.R")
r$run(port=8000)
My .R file is listed below
addTwo <- function(){
name<-c("Rajesh")
age<-c("10")
df<-data.frame(name,age)
return(df)
}
source
share