--- title: "Macronutrient Activation Screen Data" output: html_notebook --- get the data in ```{r} require(car) require(lsmeans) require(lme4) require(nlme) require(dplyr) require(tidyverse) require(gridExtra) macro.activation.data <- read_csv("./MacronutrientActivationScreen_RepresentativeData_JoVE_Pocas.csv", col_names = TRUE, na = "NA", col_types = list(Genotype = col_factor(c("R12E06", "R14B11","R19G11","R21B06", "R22H01", "R29C02", "R40D06", "R45C03", "R45D11", "R48F09", "attP2")), Food = col_double(), Date = col_character(), Abs600nm = col_double(), Concentration = col_double(), Number = col_integer(), ConcPerL3 = col_double())) macro.activation.data ``` first plot the data Gonçalo, use the scale_fill_manual and the scale_colour_manual to set the colours of the different genotypes ```{r} Fig1 <- ggplot(data = macro.activation.data, aes(x= Food, y= ConcPerL3))+ xlab("P:C Ratio")+ ylab("Food eaten per larva (mL)")+ theme_bw()+ theme(panel.grid=element_blank(),axis.title.x=element_text(size=20), axis.title.y=element_text(size=20), axis.text.y=element_text(size=16), axis.text.x=element_text(size=16), panel.background = element_rect(colour = "black"), legend.background = element_rect(), legend.key = element_rect(colour = "white"), legend.text=element_text(face="italic", size=14))+ theme(axis.title.x = element_text(vjust=-0.5), axis.title.y = element_text(vjust=1.5))+ theme(legend.title=element_blank())+ theme(legend.title=element_blank())+ guides(colour = guide_legend(nrow = 15))+ #scale_y_continuous(limits=c(-0.01,0.03))+ scale_color_manual(values = c("#f21818", "#f7439d", "#f7a643", "#f7df43", "#269142", "#27e86e", "#2ce5f2", "#2ca3f2", "#3046f0", "#aa45f7", "#d1cfcf"))+ geom_point(aes(colour = as.factor(Genotype))) + geom_smooth(aes(colour = as.factor(Genotype)), se = FALSE, method = "lm") + geom_point(data = subset(macro.activation.data, Genotype == 'attP2'), colour = "#d1cfcf")+ geom_smooth(data = subset(macro.activation.data, Genotype == 'attP2'), colour = "#d1cfcf", se = FALSE, method = "lm", size = 2)+ #geom_point() + #geom_smooth(se = FALSE, method = "lm", colour = "black") + geom_blank() Fig1 pdf("./FigFoodIntake.pdf", width=10, height=8, useDingbats=FALSE) grid.arrange(Fig1, ncol=1) dev.off() ``` ```{r} macro.activation.data$Genotype <- relevel(macro.activation.data$Genotype, ref='attP2') intake.activation.lm <- lm(ConcPerL3 ~ Food * Genotype, data = macro.activation.data) Anova(intake.activation.lm) summary(intake.activation.lm) intake.activation<-lmer(ConcPerL3 ~ Food * Genotype + (1 | Date), data = macro.activation.data) Anova(intake.activation) summary(intake.activation) ```