I am Developing an API for that I am using Plumber. I have created two function with its each endpoint. I want to use function 1 as argument in function 2 OR inheritance for example function 1 should be my parent class and function 2 will be my child class.
I want to reuse the code of function 1 for executing function 2 output.
I don't know how to do!
Please Help
Thank You in Advance
Function 1
library(plumber)
library(gwasrapidd)
#* @get /Query
simplequery <- function(query=""){
studies <- get_studies(study_id = query)
}
Function 2
#* @get /GetData
Getdata <- function(of=""){
if (of == "Studies"){
study_table <- studies@studies
.....
}
}