14  Appendix: Tips, Profiles, .libPaths

14.1 Useful Profiles

Create ~/.Rprofile to set options (be careful on shared systems):

options(
  repos = c(CRAN = "https://cloud.r-project.org"),
  scipen = 999
)

14.2 Custom Library Paths

# In .Rprofile or project-level .Rprofile
.libPaths(c("/path/to/Rlibs", .libPaths()))

14.3 Format vs formatC (quick recap)

x <- c(123.456, 0.00123456)
format(x, digits = 4)
[1] "1.235e+02" "1.235e-03"
format(x, nsmall = 2)
[1] "1.23456e+02" "1.23456e-03"
formatC(x, digits = 3, format = "f")
[1] "123.456" "0.001"  

14.4 POSIXct vs POSIXlt

  • POSIXct: seconds since epoch (numeric), compact, fast.
  • POSIXlt: list-like with components (year, mon, mday…), easier to extract parts.

14.6 Short Glossary

  • SDTM: Study Data Tabulation Model (FDA submission standard for raw domains).
  • ADaM: Analysis Data Model (derived analysis-ready datasets).
  • TLF: Tables, Listings, Figures for reporting.