Skip to content

Commit 53bbea7

Browse files
committed
Clearer output in Interface example
1 parent cca8c13 commit 53bbea7

File tree

1 file changed

+17
-9
lines changed

1 file changed

+17
-9
lines changed

R/examples.R

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,26 @@
11
interfaceExample <- function(jaspResults, dataset, options) {
22
# Just show the options as they are understood the R backend
3+
jaspResults[["explanation"]] <- createJaspHtml(title = "Outputs as html",
4+
text = "Here we show the options as they are understood by the R backend.")
35

46
# We'll build the output string by appending information to an initially empty container
57
aux <- ""
68

7-
output_string <- aux |>
8-
paste(gettextf("The tick mark is set to: %s", as.character(options$my_tick_mark), sep = "")) |>
9-
paste(gettextf("The radio buttons are set to: %s", as.character(options$radio_buttons), sep = ". ")) |>
10-
paste(gettextf("The integer is set to: %s", as.character(options$my_integer), sep = ". ")) |>
11-
paste(gettextf("The double is set to: %s", as.character(options$my_double), sep = ". ")) |>
12-
paste(gettextf("The percentage is set to: %s", as.character(options$my_percent), sep = ". ")) |>
13-
paste(gettextf("The text box is set to: %s", options$my_text, sep = ". "))
14-
15-
jaspResults[["result"]] <- createJaspHtml(text = output_string)
9+
jaspResults[["logicals"]] <- createJaspHtml(
10+
title = "Logical controls",
11+
text = aux |>
12+
paste(gettextf("The tick mark is set to: %s", as.character(options$my_tick_mark))) |>
13+
paste(gettextf("<br> The radio buttons are set to: %s", as.character(options$radio_buttons)))
14+
)
15+
16+
jaspResults[["keyboard"]] <- createJaspHtml(
17+
title = "Keyboard controls",
18+
text = aux |>
19+
paste(gettextf("The integer is set to: %s", as.character(options$my_integer), sep = "")) |>
20+
paste(gettextf("<br> The double is set to: %s", as.character(options$my_double), sep = ". ")) |>
21+
paste(gettextf("<br> The percentage is set to: %s", as.character(options$my_percent), sep = ". ")) |>
22+
paste(gettextf("<br> The text box is set to: <i>%s</i>", options$my_text, sep = ". "))
23+
)
1624

1725
return()
1826
}

0 commit comments

Comments
 (0)