Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

error in repress code if using demo data in French #53

Open
sebdalgarno opened this issue Dec 14, 2024 · 0 comments
Open

error in repress code if using demo data in French #53

sebdalgarno opened this issue Dec 14, 2024 · 0 comments

Comments

@sebdalgarno
Copy link
Member

not using the demo data with French names

library(ssdtools)
library(ggplot2)
library(dplyr)

data <- ssddata::ccme_boron
colnames(data) <- make.names(colnames(data))

dist <- ssd_fit_dists(data, left = 'Conc', dists = c('gamma', 'lgumbel', 'llogis', 'lnorm', 'lnorm_lnorm', 'weibull'), silent = TRUE, reweight = FALSE, rescale = FALSE)
ssd_plot_cdf(dist, ylab = 'Pourcentage d’espèces affectées', xlab = 'Concentration', delta = Inf,
average = NA, theme_classic = TRUE, text_size = 14)

ssd_gof(dist) %>% dplyr::mutate_if(is.numeric, ~ signif(., 3))

ggsave('fit_dist_plot.png', width = 8 , height = 6 , dpi = 300)

pred <- predict(dist, proportion = unique(c(1:99, 5.63)/100))
ssd_plot(data, pred, left = 'Conc', label = 'Espèce', shape = NULL, color = 'Groupe',
label_size = 4, ylab = 'Pourcentage d’espèces affecté', xlab = 'Concentration', ci = FALSE, shift_x = 1.05, hc = 0.0563,
big.mark = ' ', trans = 'log10', xlimits = c(NA, 2000), xbreaks = c(1, 10, 100, 1000), text_size = 14, theme_classic = TRUE) +
ggtitle('hi') +
scale_color_brewer(palette = 'Dark2', name = 'Groupe') +
scale_shape(name = NULL)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant