Skip to content

Commit

Permalink
correcting factor() calls
Browse files Browse the repository at this point in the history
  • Loading branch information
milesmedina committed May 8, 2024
1 parent 0de8844 commit bad29ac
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions R/logistic_ex.R
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,11 @@ toplo <- toprd |>
prd = prds$fit,
hival = prds$fit + 1.96 * prds$se.fit,
loval = prds$fit - 1.96 * prds$se.fit,
Turbidity = factor(Turbidity, labels = c('95th %tile','mean'))
Turbidity = factor( Turbidity, labels = c('95th %tile','mean'), levels = unique(Turbidity) )
)

# get lines to show connection between hypothetical target and certainty of meeting threshold
trgs <- crossing(
trgs <- expand_grid(
value = c(50),
Turbidity = c( quantile(tomod$Turbidity, 0.95), mean(tomod$Turbidity) )
)
Expand All @@ -45,7 +45,7 @@ tolns <- trgs |>
prd = lnprds$fit,
hival = lnprds$fit + 1.96 * lnprds$se.fit,
loval = lnprds$fit - 1.96 * lnprds$se.fit,
Turbidity = factor(Turbidity, labels = c('mean', '95th %tile'))
Turbidity = factor( Turbidity, labels = c('95th %tile','mean'), levels = unique(Turbidity) )
)

# plot
Expand Down

0 comments on commit bad29ac

Please sign in to comment.