Convert a design list to a
json_design(design, filename = NULL, digits = 8, pretty = FALSE, ...)
| design | a design list including within, between, n, mu, sd, r, dv, id |
|---|---|
| filename | option name of faile to save the json to |
| digits | number of digits to save |
| pretty | whether to print condensed or readable |
| ... | other options to send to jsonlite::toJSON |
a JSON string
json_design(des)#> {"within":{"A":{"A1":"A1","A2":"A2"}},"between":{"B":{"B1":"B1","B2":"B2"}},"dv":{"y":"value"},"id":{"id":"id"},"n":{"B1":100,"B2":100},"mu":{"B1":{"A1":0,"A2":0},"B2":{"A1":0,"A2":0}},"sd":{"B1":{"A1":1,"A2":1},"B2":{"A1":1,"A2":1}},"r":{"B1":[[1,0],[0,1]],"B2":[[1,0],[0,1]]}}json_design(des, pretty = TRUE)#> { #> "within": { #> "A": { #> "A1": "A1", #> "A2": "A2" #> } #> }, #> "between": { #> "B": { #> "B1": "B1", #> "B2": "B2" #> } #> }, #> "dv": { #> "y": "value" #> }, #> "id": { #> "id": "id" #> }, #> "n": { #> "B1": 100, #> "B2": 100 #> }, #> "mu": { #> "B1": { #> "A1": 0, #> "A2": 0 #> }, #> "B2": { #> "A1": 0, #> "A2": 0 #> } #> }, #> "sd": { #> "B1": { #> "A1": 1, #> "A2": 1 #> }, #> "B2": { #> "A1": 1, #> "A2": 1 #> } #> }, #> "r": { #> "B1": [ #> [1, 0], #> [0, 1] #> ], #> "B2": [ #> [1, 0], #> [0, 1] #> ] #> } #> }