-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add testing script; fixed problem with parameter nesting for rmaMvModel
- Loading branch information
Showing
3 changed files
with
34 additions
and
7 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 |
---|---|---|
|
@@ -26,3 +26,4 @@ export(checkIntegrity) | |
export(checkData) | ||
export(checkParameter) | ||
export(createData) | ||
export(testListParameter) |
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,22 @@ | ||
library(jsonlite) | ||
|
||
testListParameter <- function(nesting = NULL) { | ||
# Parse the JSON input string | ||
nesting <- fromJSON(nesting) | ||
|
||
# Initialize an empty list to store the formulas | ||
nest <- list() | ||
|
||
# Iterate over the parsed JSON array and create formulas | ||
for (i in seq_along(nesting)) { | ||
# Create a formula and assign it to the nest list | ||
nest[[i]] <- as.formula(paste("~1 |", nesting[[i]])) | ||
} | ||
|
||
# Print the resulting nest list | ||
print(nest) | ||
|
||
# Original nest2 for comparison | ||
nest2 <- list(~1 | outcome_ID, ~1 | sample_ID, ~1 | report_ID) | ||
print(nest2) | ||
} |