Skip to content

Commit

Permalink
Merge pull request #20 from openpharma/14-use-of-ggplot2aes_string-is…
Browse files Browse the repository at this point in the history
…-deprecated-and-should-be-replaced

replaced aes_string with aes
  • Loading branch information
MThomas91 authored Jan 20, 2025
2 parents 31907f7 + 404f109 commit cbeb8e3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions R/Mods.R
Original file line number Diff line number Diff line change
Expand Up @@ -269,12 +269,12 @@ plotMods <- function(ModsObj, nPoints = 200, superpose = FALSE,
dose = rep(doseSeq, ncol(resp)),
model = modelfact)
if(superpose){
pp <- ggplot2::ggplot(respdata, ggplot2::aes_string(x="dose", y="response", col="model"))+
pp <- ggplot2::ggplot(respdata, ggplot2::aes(x=.data$dose, y=.data$response, col=.data$model))+
ggplot2::geom_line(size=1.2)+
ggplot2::theme_bw()+
ggplot2::theme(legend.position = "top", legend.title = ggplot2::element_blank())
} else {
pp <- ggplot2::ggplot(respdata, ggplot2::aes_string(x="dose", y="response"))+
pp <- ggplot2::ggplot(respdata, ggplot2::aes(x=.data$dose, y=.data$response))+
ggplot2::geom_line(size=1.2)+
ggplot2::theme_bw()+
ggplot2::facet_wrap(~model, labeller = ggplot2::label_wrap_gen())
Expand All @@ -287,7 +287,7 @@ plotMods <- function(ModsObj, nPoints = 200, superpose = FALSE,
dose = rep(doses, ncol(resp)),
model = modelfact2)
pp +
ggplot2::geom_point(ggplot2::aes_string(x="dose", y="response"), size=1.8, data=respdata2) +
ggplot2::geom_point(ggplot2::aes(x=.data$dose, y=.data$response), size=1.8, data=respdata2) +
ggplot2::xlab(xlab) +
ggplot2::ylab(ylab)
}
Expand Down
2 changes: 1 addition & 1 deletion R/optContr.R
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ plotContr <- function(optContrObj, xlab = "Dose", ylab = "Contrast coefficients"
dose = rep(as.numeric(dimnames(cM)[[1]]), nM),
model = factor(rep(mod_nams, each = nD), levels=mod_nams),
levels = dimnames(cM)[[2]])
ggplot2::ggplot(cMtr, ggplot2::aes_string("dose", "resp", col="model"))+
ggplot2::ggplot(cMtr, ggplot2::aes(.data$dose, .data$resp, col=.data$model))+
ggplot2::geom_line(size=1.2)+
ggplot2::geom_point()+
ggplot2::theme_bw()+
Expand Down

0 comments on commit cbeb8e3

Please sign in to comment.