Skip to content

Commit

Permalink
further bug fixing on rmamvmodel
Browse files Browse the repository at this point in the history
  • Loading branch information
Rostu committed Sep 4, 2024
1 parent 4557bed commit f078065
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 0 deletions.
1 change: 1 addition & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,4 @@ export(checkData)
export(checkParameter)
export(createData)
export(testListParameter)
export(testpredParameter)
14 changes: 14 additions & 0 deletions R/rmaMVModel.R
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,20 @@ rmaMVModel <- function(yi,vi,measure,d,pred1=NULL,pred2=NULL,nesting=NULL) {
if(!is.null(nesting)){
nesting <- jsonlite::fromJSON(nesting)
}
if(!is.null(pred1)){
# Parse the JSON string into a list
pred1<-jsonlite::fromJSON(pred1)

# Convert the list to a vector
pred1 <- unlist(pred1)
}
if(!is.null(pred2)){
# Parse the JSON string into a list
pred2<-jsonlite::fromJSON(pred2)

# Convert the list to a vector
pred2 <- unlist(pred2)
}

checkParameter(dat,c(yi,vi))

Expand Down
14 changes: 14 additions & 0 deletions R/testFunctions.R
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,17 @@ testListParameter <- function(nesting = NULL) {
nest2 <- list(~1 | outcome_ID, ~1 | sample_ID, ~1 | report_ID)
print(nest2)
}


testpredParameter<-function(pred1){


# Parse the JSON string into a list
pred1<-jsonlite::fromJSON(pred1)

# Convert the list to a vector
pred1 <- unlist(pred1)

print(pred1)
pred1["value"]
}

0 comments on commit f078065

Please sign in to comment.