Udo Gniß
Udo Gniß

Reputation: 63

Display value in RStudio

I have created a variable x=11.5. I want now to display x in the viewer pane in RStudio.

Is there a way how to display it and adjust fonts and colors?

x <- 11.5

Upvotes: 0

Views: 617

Answers (1)

user2554330
user2554330

Reputation: 44867

This is one way:

x <- 11.5
library(htmltools)
html_print(x)

This displays just the number in the viewer pane:

enter image description here

If you want to change fonts etc., you'd use HTML type things to do that. For example, wrap the number in <a style="font-size: 100px"></a> using

html_print(a(x, style="font-size: 100px"))

Upvotes: 2

Related Questions