I am now running a fully updated and well-configured R environment on my Debian 13 (Trixie) system.
- R version: 4.5.3 (latest available)
- RStudio version: 2025.09.2 (recently updated)
- tidyverse: Successfully installed and working (version 2.0.0)
- Library location: My personal library at /home/lvydvy/R/x86_64-pc-linux-gnu-library/4.5 (this is the recommended and safest setup)
Everything is installed cleanly with all the necessary system dependencies. I no longer need to worry about permission issues when installing packages.
I can start RStudio anytime by typing rstudio & in the terminal.
Status: Ready to go! ✅
library(tidyverse)
1. Core Data Manipulation (dplyr)
| What I Want to Do | My Command |
|---|---|
| Filter rows | df %>% filter(age > 30) |
| Select columns | df %>% select(name, age, score) |
| Create new columns | df %>% mutate(bmi = weight / height^2) |
| Rename columns | df %>% rename(full_name = name) |
| Sort data | df %>% arrange(desc(score)) |
| Get summary statistics | df %>% summarise(mean_age = mean(age)) |
| Group + Summarise | df %>% group_by(department) %>% summarise(avg_score = mean(score)) |
2. My Favorite Pipe Workflow
R
df %>%
filter(age > 25) %>%
select(name, age, score) %>%
mutate(score_per_year = score / age) %>%
arrange(desc(score_per_year)) %>%
head(10)
3. tidyr – Cleaning Data
| Task | Command |
|---|---|
| Pivot longer | pivot_longer(cols = c(col1, col2)) |
| Pivot wider | pivot_wider(names_from = year) |
| Separate one column | separate(full_name, into = c(“first”, “last”), sep = ” “) |
| Drop rows with NA | drop_na() |
4. ggplot2 – Quick Plots I Love
R
# Scatter plot
ggplot(df, aes(x = age, y = score, color = department)) +
geom_point(size = 3) +
theme_minimal()
# Bar chart
ggplot(df, aes(x = department, y = score)) +
geom_col(fill = "steelblue") +
theme_minimal()
# Histogram
ggplot(df, aes(x = score)) +
geom_histogram(bins = 20, fill = "darkcyan")
5. Other Useful Commands
R
glimpse(df) # Quick overview of data
count(df, department) # Count frequencies
slice_max(df, score, n = 5) # Top 5 rows
slice_sample(df, n = 100) # Random sample
Tip from me: Always start with the pipe %>% — it makes my code much more readable.