forked from treeppl/treepplr
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
35 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,7 +16,9 @@ Imports: | |
dplyr, | ||
jsonlite, | ||
magrittr, | ||
rlang | ||
rlang, | ||
strex, | ||
tidyr | ||
Suggests: | ||
ggplot2, | ||
knitr, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
#' Prepare input for inference with TreePPL | ||
#' | ||
#' This function takes R objects and writes out an JSON file to be used by `run_treeppl()`. | ||
#' | ||
#' @param object_list A list of R objects to be included in the JSON input file. | ||
#' @param file_path The complete path to where the JSON file is to be written. | ||
#' | ||
#' @return Path to a JSON file | ||
#' @export | ||
#' | ||
#' @examples | ||
treeppl_input <- function(object_list, file_path){ | ||
|
||
# process one element at a time? | ||
|
||
# figure out the class and if anything special is necessary | ||
|
||
# write json with input data | ||
input_json <- jsonlite::toJSON(data, dataframe = "columns") | ||
write(input_json, paste0(dir,"/input.json")) | ||
|
||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters