Skip to content

R Tips & Tricks

Joey Kleiner edited this page Dec 5, 2023 · 22 revisions

R installs:

# check R version
R.Version()
.libPaths()

ip = as.data.frame(installed.packages()[,c(1,3:4)])

Keyboard Shortcuts: https://support.posit.co/hc/en-us/articles/200711853-Keyboard-Shortcuts-in-the-RStudio-IDE

Ctrl+Shift+A  # Reformat Selection
install.packages('pkgname')

On Ubuntu

R # to enter the R environment
q() # to quit
cd /var/www/R

install package "rhdf5"

if (!require("BiocManager", quietly = TRUE))
    install.packages("BiocManager")
BiocManager::install(version = "3.16")

BiocManager::install(c("rhdf5"))

R Markdown

Mac

  • Updated Keyboard Shortcut for "Run Current Line or Selection" from Cmd+Enter to Cmd+R
  • For running Rmd:
    • Tried installing TinyTeX in R: tinytex::install_tinytex()
    • still need admin auth for this method

Clone this wiki locally