Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change JSON postBody to data frame and return data frame #513

Closed
mansi-aggarwal-2504 opened this issue Mar 18, 2020 · 1 comment
Closed

Comments

@mansi-aggarwal-2504
Copy link

I want to receive a JSON object, and then covert it into a data frame and do something and then return a data frame.
Something like this:

#' @post /test

function(req){
  myData <- fromJSON(req$postBody)
  df <- as.data.frame(myData)
  doSomething(df) #for ex, run a linear regression model
  return(result) # result is a data frame object 
}

I have tried a lot of things here and there but it just doesn't work. Can someone help me out?

@shrektan
Copy link
Contributor

I believe this is the same question as #512. My answer there should work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants