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

Extracting a table as result #59

Closed
KDIncognito opened this issue Oct 5, 2016 · 2 comments
Closed

Extracting a table as result #59

KDIncognito opened this issue Oct 5, 2016 · 2 comments

Comments

@KDIncognito
Copy link

Hi,

I have an R code that connects with an API, gets content in the form of a table, and I transform that data, and modify, create columns, add filters, bind it with other content, and another table is produced towards the end. I am hoping to convert my code into an API and go further from there. I tried the Get method, and I keep failing. Since I can not paste the whole code, I am going share a summary of that code. Please try and help me out.

segment<- NULL #this has to be a variable for the API Get/Post 

toCall<- APIfunction("api credentials", segment) # my api to retrieve data, which currently works

df<- as.data.frame.list(toCall)

#This followed by some lines to transform data, remove unwanted columns/rows etc
#input from the above dataframe goes into the check function below
CheckFunction<- function1

CorrectFunction<- function2 #takes input from above function

rbind.results
structure the output
print(head(output))

I tried to write a Get query and call the final output and I get a 404 error.
I know this is not much to go with, but my hands are tied. Please help! Thank you!

@FvD
Copy link
Contributor

FvD commented Oct 6, 2016

You have not added any code related to plumber. Suppose you want to make a get request to http://localhost:port/myoutput you would need something like:

#* @get /myoutput
myfunction <- function() {
 [... all your code ..]
 return(output)
}

Did you write a working function and have you added the plumber decorator? The documentation for this package is very good and has great examples. I would suggest you read through that again.

@trestletech
Copy link
Contributor

Hi. I'd need a plumber file that reproduces the example. No worries if you can't share the full code but I'd need something to work off of in order to debug.

Closing for now but we can reopen if you're able to repro in something that you can share.

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

3 participants