Most of the times I prefer to use the reap command ( and ) to get the output on the console.
For example,
(logical_sample <- c(0,1,0,1,0,1,0,1,0))
(sample_mean <- mean(logical_sample))
(sample_st_deviation <- sd(logical_sample))
(n <- length(logical_sample))
Is there a short cut for in Rstudi for un/parenthesizing. For example, you can use command + shift + c for uncommenting.