How to add characters to slider shortcuts?

I am trying to add symbols and mathematical expressions for slider shortcuts, for example. instead of "Choose lambda." I want the label to say "Choose & lambda ;:". I tried several variations of HTML and expression (), for example:

sliderInput ("lambda1", label=HTML("Choose &-lambda;:"), min=0, max=10, value=1.1, step=0.1) 

with a removed hyphen (I put it there to interrupt formatting in this editor).

and:

sliderInput("lambda1", label=expression(lambda), min=0, max=10, value=1.1, step=0.1).

In all cases, the label is displayed as " Choose &-lambda;:" (without a hyphen), not "Choose & lambda ;:".

I also need indexes and superscripts, but haven't tried the code yet. I assume that if I can get HTML characters, I can format indexes, etc. Relevant tags.

Edit
Sorry, I can not answer myself, because I am a new user. I found the answer to the Greek symbolic part of the question. This is ironic, because I hit my head about this issue for a week, and then an hour after posting the question, I realized this. D'o!

Turn on the function HTML()with div(HTML()). Thusly:

sliderInput ("lambda1", label=div(HTML("Choose &-lambda;:")), min=0, max=10, value=1.1, step=0.1),

again without a hyphen in <-lambda ;.

It worked!

+4
source share
1 answer

This error message is here and fixed in the brilliant development version . HTML()should work with labels sliderInput()in brilliant> = 0.9.0.

+1
source

Source: https://habr.com/ru/post/1525718/


All Articles