Is it possible to change the way the RStudio environment pane displays the value of variables?
My specific use case is that I am working with the units
package. For anyone not familiar with it, units
allows you to assign units to variables and will perform unit conversion and so on when you perform operations on the variables.
An example:
library(units)
distance_travelled <- units::set_units(100, m)
time_taken <- units::set_units(30, s)
average_speed <- distance_travelled / time_taken
average_speed
average_speed
prints to the console as 3.333333 [m/s]
. However, in the RStudio environment pane it just displays the variable name and Object of class units
. Is there a way of overriding the default behaviour so the environment pane displays the units and value?
Here's a screenshot for reference.
I'm using Rstudio server 1.2.5033 via the Docker image rocker/tidyverse
.
Any tips would be much appreciated!