gpt-3.5-turbo-0613· OpenAI
WildChat-4.8M (AI2)
in ggplot(TcCarottemlf, aes(x = TestJourCroissance, y = CFUg,fill = Bacterie)) +…
- User
in ggplot(Tc_Carotte_mlf, aes(x = Test_Jour_Croissance, y = CFU_g,fill = Bacterie)) + geom_boxplot() + # stat_compare_means(aes(group = Bacterie), label = "p")+ labs(title ="Comparaison CFU/g pour Carotte", x = "Test", y = "CFU_g") + scale_fill_manual(values = couleurs_bacterie, guide = guide_legend(title = "Bacterie")) + theme_minimal() + scale_y_log10(limits = c(10^0, 10^7), breaks = 10^(0:7)) how add NA values
- Assistant
To add NA values in the ggplot, you can use the na.omit() function to remove NA values from your dataset before plotting. Here's how you can modify your code to include NA values:
ggplot(na.omit(Tc_Carotte_mlf), aes(x = Test_Jour_Croissance, y = CFU_g, fill = Bacterie)) + geom_boxplot() + labs(title ="Comparaison CFU/g pour Carotte", x = "Test", y = "CFU_g") + scale_fill_manual(values = couleurs_bacterie, guide = guide_legend(title = "Bacterie")) + theme_minimal() + scale_y_log10(limits = c(10^0, 10^7), breaks = 10^(0:7))The na.omit() function will remove any rows with NA values before plotting the data.