#library
library(ggplot2)
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
#theme
my_theme<-function(x){theme_bw()+
theme(text = element_text(size=20))+
theme(axis.line.y = element_line(size = 2.0))+
theme(axis.line.x = element_line(size = 2.0))+
theme(axis.ticks = element_line(size = 1.5,colour="black"))+
theme(axis.ticks.length= unit(0.45, "cm"))+
theme(axis.title.y =element_text(vjust=1.2))+
theme(axis.title.x =element_text(vjust=-0.2))+
theme(axis.text=element_text(colour="black"))+
theme(panel.background = element_rect(fill ="white"))}
#data import (you should have run nonmem models shown in the class already for the codes below to work. Please follow instructions from word document posted for running models.)
oralmd1csim<-read.table("C:\\Heller\\Phar7380\\Week6\\oralmd1c.res",header=T,skip=1)
#oralmd2csim<-read.table("C:\\Ayyappa\\PHAR7380\\Week6\\oralmd.res",header=T,skip=1)
#plot, 1 comp multiple dose simulation done in video
ggplot(data=oralmd1csim,aes(TIME,IPRED))+
geom_line(linewidth=0.5)+
geom_point(linewidth=2)+
scale_x_continuous(limits = c(0,120),breaks = c(0,24,48,72,96,120))+
theme_bw()+
my_theme()+
labs(x="Time after dose (hour)",y="Plasma concentration (ng/ml)")+
geom_hline(yintercept = c(5,15), linetype="dashed", color = "red")
## Warning in geom_point(linewidth = 2): Ignoring unknown parameters: `linewidth`
## Warning: The `size` argument of `element_line()` is deprecated as of ggplot2 3.4.0.
## i Please use the `linewidth` argument instead.
## This warning is displayed once every 8 hours.
## Call `lifecycle::last_lifecycle_warnings()` to see where this warning was
## generated.
#plot, 2 comp multiple dose simulation done in video
#ggplot(data=oralmd2csim,aes(TIME,IPRED))+
#geom_line(size=0.5)+
#geom_point(size=2)+
#scale_x_continuous(limits = c(0,120),breaks = c(0,24,48,72,96,120))+
#theme_bw()+
#my_theme()+
#labs(x="Time after dose (hour)",y="Plasma concentration (ng/ml)")+
#geom_hline(yintercept = c(5,15), linetype="dashed", color = "red")