Skip to content

Commit

Permalink
adding more changes from posit course
Browse files Browse the repository at this point in the history
  • Loading branch information
goodekat committed Jan 15, 2025
1 parent 5757352 commit 68b9569
Show file tree
Hide file tree
Showing 54 changed files with 105,594 additions and 31,997 deletions.
2 changes: 1 addition & 1 deletion .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@
^doc$
^docs$
^figures$
^\.github$
^Ideas for Future Work$
^Meta$
^pkgdown$
^README_files$
^README\.Rmd$
^residuals.Rmd$
^tests.R$
^\.github$
8 changes: 7 additions & 1 deletion R/plot_auxindex.R
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,13 @@ plot_auxindex <- function(resid, smoother, theme, axis.text.size, title.text.siz
# If smoother is set to true, add it to the plot
if (smoother == TRUE){
plot <- plot +
geom_smooth(method = "loess", se = FALSE, color = "red", size = 0.5)
geom_smooth(
method = "loess",
se = FALSE,
color = "red",
linewidth = 0.5,
formula = 'y ~ x'
)
}

# Add theme to plot
Expand Down
2 changes: 1 addition & 1 deletion R/plot_auxqq.R
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ plot_auxqq <- function(resid, theme, axis.text.size, title.text.size, title.opt,

# Add a line if requested
if(qqline == TRUE){
plot <- plot + stat_qq_line(color = "blue", size = .5)
plot <- plot + stat_qq_line(color = "blue", linewidth = .5)
}

# Add theme to plot
Expand Down
4 changes: 2 additions & 2 deletions R/plot_constlev.R
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,8 @@ plot_constlev <- function(model, type, theme, axis.text.size, title.text.size, t
na.rm = TRUE
) +
geom_point(aes(group = {Data}), alpha = alpha) +
#geom_line(aes(x = {Lowess.x}, y = {Lowess.y}), color = "red", size = 0.5) +
geom_abline(slope = 0, intercept = 0, color = "blue", size = 0.5) +
#geom_line(aes(x = {Lowess.x}, y = {Lowess.y}), color = "red", linewidth = 0.5) +
geom_abline(slope = 0, intercept = 0, color = "blue", linewidth = 0.5) +
xlab("Factor Level Combinations") +
ylab("Standardized Residuals")

Expand Down
8 changes: 7 additions & 1 deletion R/plot_index.R
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,13 @@ plot_index <- function(model, type, smoother, theme, axis.text.size, title.text.
# If smoother is set to true, add it to the plot
if (smoother == TRUE){
plot <- plot +
geom_smooth(method = "loess", se = FALSE, color = "red", size = 0.5)
geom_smooth(
method = "loess",
se = FALSE,
color = "red",
linewidth = 0.5,
formula = 'y ~ x'
)
}

# Add theme to plot
Expand Down
5 changes: 3 additions & 2 deletions R/plot_lev.R
Original file line number Diff line number Diff line change
Expand Up @@ -180,13 +180,14 @@ plot_lev <- function(model, type, smoother, theme, axis.text.size, title.text.si
# no sense
if (smoother == TRUE){
plot <- plot #+
#geom_smooth(data = model_values,
# geom_smooth(data = model_values,
# aes(x = {Leverage}, y = {Std_Res}),
# na.rm = TRUE,
# method = "loess",
# se = FALSE,
# color = "red",
# size = 0.5)
# size = 0.5,
# formula = 'y ~ x')
}

# Add Cook's D lines if they are inside the limits of the plot
Expand Down
8 changes: 7 additions & 1 deletion R/plot_ls.R
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,13 @@ plot_ls <- function(model, type, smoother, theme, axis.text.size, title.text.siz
# If smoother is set to true, do not add it to the plot
if (smoother == TRUE){
plot <- plot #+
# geom_smooth(method = "loess", se = FALSE, color = "red", size = 0.5)
# geom_smooth(
# method = "loess",
# se = FALSE,
# color = "red",
# linewidth = 0.5,
# formula = 'y ~ x'
# )
}

# Add theme to plot
Expand Down
2 changes: 1 addition & 1 deletion R/plot_qq.R
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ plot_qq <- function(model, type, theme, axis.text.size, title.text.size, title.o

# Add a line if requested
if (qqline == TRUE) {
plot <- plot + stat_qq_line(color = "blue", size = .5)
plot <- plot + stat_qq_line(color = "blue", linewidth = .5)
}

# Add theme to plot
Expand Down
8 changes: 7 additions & 1 deletion R/plot_resid.R
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,13 @@ plot_resid <- function(model, type, smoother, theme, axis.text.size,
# If smoother is set to true, add it to the plot
if (smoother == TRUE){
plot <- plot +
geom_smooth(method = "loess", se = FALSE, color = "red", size = 0.5)
geom_smooth(
method = "loess",
se = FALSE,
color = "red",
linewidth = 0.5,
formula = 'y ~ x'
)
}

# Add theme to plot
Expand Down
10 changes: 9 additions & 1 deletion R/resid_xpanel.R
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,15 @@ create_predictor_plots <- function(x_column_number, y_column_number,

# Add a smoother to the plots if requested
if(smoother == TRUE){
plot <- plot + geom_smooth(method = "loess", se = FALSE, color = "red", size = 0.5)
plot <-
plot +
geom_smooth(
method = "loess",
se = FALSE,
color = "red",
linewidth = 0.5,
formula = 'y ~ x'
)
}

# Add theme to plot
Expand Down
1 change: 0 additions & 1 deletion inst/ideas-for-future-work.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
- Write up list of questions
- Work through Mark's examples
- Check in with Mark
- Work in updates from posit course
- Clean up old to do list
- Ask Katie about changing her email address
- Work through list of issues on GitLab
Expand Down
Loading

0 comments on commit 68b9569

Please sign in to comment.