Hi and thanks for fixing up my post. I didn't include my code because I noticed it wasn't reproducible on my colleague's machine, but if it helps here is my code:
structure(list(Concentration = c("20%", "50%", "100%", "20%",
"50%", "100%", "20%", "50%", "100%"), Mass = c(0.01, 0.04, 0.046666667,
0.02, 0.04, 0.076666667, 0.03, 0.05, 0.09), OD = c(0.405, 0.846,
1.581, 0.267, 0.645, 1.196, 0.497, 0.992, 1.536), Strain = c("A",
"A", "A", "B", "B", "B", "C", "C", "C")), class = "data.frame", row.names = c(NA,
-9L))
#> Concentration Mass OD Strain
#> 1 20% 0.01000000 0.405 A
#> 2 50% 0.04000000 0.846 A
#> 3 100% 0.04666667 1.581 A
#> 4 20% 0.02000000 0.267 B
#> 5 50% 0.04000000 0.645 B
#> 6 100% 0.07666667 1.196 B
#> 7 20% 0.03000000 0.497 C
#> 8 50% 0.05000000 0.992 C
#> 9 100% 0.09000000 1.536 C
Created on 2019-08-02 by the reprex package (v0.3.0)
library(ggplot2)
library(reshape2)
library(gridExtra)
#> Warning: package 'gridExtra' was built under R version 3.5.3
#>rawData = read.csv('MyData.csv',header=TRUE,stringsAsFactors = FALSE)
p1=ggplot(data=rawData,aes(x=`Mass`,y=`OD`))+
geom_point(data=rawData,aes(x=`Mass`,y=`OD`,colour=`Strain`),size=2)+
geom_smooth(method = lm,formula=y~x,mapping=NULL, se = TRUE)+
theme_classic()+
labs(title="Grouped Fit",x=bquote('Weight [g]'),y=(expression(OD[600]~" [units]")))+
theme(legend.position="none",plot.title = element_text(hjust = 0.5),aspect.ratio=1,panel.border=element_rect(fill=NA,colour="black"),strip.background = element_rect(colour=NA, fill=NA),axis.text = element_text(colour = "black"),text = element_text(size=10), plot.background = element_rect(fill = "transparent", colour = NA), legend.background = element_rect(fill="transparent"),legend.key = element_rect(fill = "transparent", colour = "transparent"),panel.background = element_rect(fill = "transparent"))
#> Error in ggplot(data = rawData, aes(x = Mass, y = OD)): object 'rawData' not found
p2=ggplot(data=rawData,aes(x=`Mass`,y=`OD`,colour=`Strain`))+
geom_point(size=2)+
geom_smooth(method = lm,formula=y~x,mapping=NULL, se = TRUE)+
theme_classic()+
labs(title="Individual Fit",x=bquote('Weight [g]'),y=(expression(OD[600]~" [units]")))+
theme(legend.position="bottom",plot.title = element_text(hjust = 0.5),aspect.ratio=1,panel.border=element_rect(fill=NA,colour="black"),strip.background = element_rect(colour=NA, fill=NA),axis.text = element_text(colour = "black"),text = element_text(size=10), plot.background = element_rect(fill = "transparent", colour = NA), legend.background = element_rect(fill="transparent"),legend.key = element_rect(fill = "transparent", colour = "transparent"),panel.background = element_rect(fill = "transparent"))
#> Error in ggplot(data = rawData, aes(x = Mass, y = OD, colour = Strain)): object 'rawData' not found
grid.arrange(p1, p2, nrow = 1)
#> Error in arrangeGrob(...): object 'p1' not found
Created on 2019-08-02 by the reprex package (v0.3.0)
Ironically I got another warning just installing the reprex() package:
package ‘reprex’ successfully unpacked and MD5 sums checked
The downloaded binary packages are in
C:\Users\---\AppData\Local\Temp\Rtmpy2a64d\downloaded_packages
Warning message:
In valid.data(rep(units, length.out = length(x)), data) :
reached elapsed time limit
I don't think it's an issue with my code, because it runs on base R fine (fast and with no warning messages), but I could be wrong.