Recently Published
Plot
# Load ggplot2 for visualization
library(ggplot2)
# Plot blood pressure over time by treatment group
ggplot(longitudinal_data, aes(x = Time, y = Blood_Pressure, color = Treatment)) +
geom_line(aes(group = Patient_ID), alpha = 0.3) + # Individual patient lines
stat_summary(fun = mean, geom = "line", size = 1.2, aes(group = Treatment)) + # Mean line
labs(title = "Blood Pressure over Time by Treatment Group", x = "Time", y = "Blood Pressure") +
theme_minimal()
Assignment 7
Data 624
Exploring linear regression models
Group 18 Assignment 6
Group 18 Assignment 6
Reading and writing tabular data in plain-text files (CSV, TSV, etc.)
In my exploration of handling CSV files, I focused on key parameters like file paths, headers, separators, and handling missing data. I found read.csv in base R convenient for its defaults, but I appreciated the readr package's read_csv for faster performance and better control over data types. The data.table package's fread impressed me with its speed and flexibility, guessing delimiters and variable types automatically.
For exporting, I relied on write.csv for simplicity, while write_csv from readr offered efficiency and better formatting. Managing multiple CSV files became streamlined with list.files and lapply, allowing easy combination into a single data frame.
Fixed-width files posed unique challenges, but read.fwf in base R and read_fwf from readr helped me handle them effectively by specifying or guessing column widths, enhancing both speed and flexibility. Overall, each tool provided valuable techniques for efficient data manipulation.