This module explores the functionallity of dplyr using the Theophylline pharmacokinetic dataset. This module: - Shows the basic funcitonaly of dplyr. - Shows how ggplot2 can be incoorperated into dplyr functions.
#Project ##Data Preproccesing
library(dplyr)
Attaching package: 'dplyr'
The following objects are masked from 'package:stats':
filter, lag
The following objects are masked from 'package:base':
intersect, setdiff, setequal, union
theoph |>filter(Subject ==1) |>select(Subject, Time, conc) |>ggplot(aes(x = Time, y = conc, group = Subject)) +geom_line() +ggtitle("Theophylline Concentration over Time")
##Part 7:
theoph |>select(Subject, Time, conc) |>ggplot(aes(x = Time, y = conc, col = Subject)) +geom_line() +ggtitle("Theophylline Concentration over Time")
##Part 8:
theoph |>select(Subject, Time, conc) |>ggplot(aes(x = Time, y = conc,)) +geom_line() +facet_wrap(~ Subject) +ggtitle("Theophylline Concentration over Time")
#DISCLAIMER: ChatGPT was used during the process of writing the code for the purpose of debugging and fixing errors in the code.