<div dir="ltr">Prezados listeiros, antes de atualizar o R para a versão 3.3.1, o script abaixo rodava sem erros (apenas um Warning). segue a estrutura dos dados<div><br></div><div><div>require(car)</div><div>require(<a href="http://compute.es">compute.es</a>)</div><div>require(effects)</div><div>require(ggplot2)</div><div>require(multcomp)</div><div>require(pastecs)</div><div>require(WRS2)</div><div>require(extrafont)</div><div>require(scales)</div><div><br></div><div><div>str(d)</div><div>'data.frame':<span class="" style="white-space:pre">      </span>60 obs. of  13 variables:</div><div> $ Top    : Factor w/ 2 levels "P","V": 2 2 2 2 2 2 2 2 2 2 ...</div><div> $ nome2  : Factor w/ 3 levels "Eschweilera_spp",..: 3 3 3 3 3 3 3 3 3 3 ...</div><div> $ Stem   : num  1212 896 769 935 477 ...</div><div> $ Crown  : num  650 499 199 344 129 ...</div><div> $ AGB    : num  1862 1395 967 1279 606 ...</div><div> $ HT     : num  27.9 26.1 25.7 26.8 20.6 ...</div><div> $ DBH    : num  34.6 31.6 27.6 29.8 24.5 20 38.8 35 38.1 19.5 ...</div><div> $ Center : num  11.61 10.86 9.48 10.8 8.14 ...</div><div> $ failure: Factor w/ 2 levels "snap","uprooted": 1 1 1 1 1 1 1 1 1 1 ...</div><div> $ CTM    : num  260554 197344 131775 195757 133708 ...</div><div> $ SWD    : num  0.9 0.79 0.84 0.82 0.82 0.92 0.81 0.83 0.86 0.9 ...</div><div> $ slender: num  80.7 82.6 93.1 90 84.1 ...</div><div> $ grain  : Factor w/ 3 levels "cross","interlocked",..: 3 3 3 3 3 3 3 3 3 3 ...</div></div><div><br></div><div>####SCRIPT###########</div><div><div>lb1 <- expression(paste(M[crit]~'(kN-m)')) # Critical turning moment</div><div>lb2 <- expression(paste("AGB (kg)")) # biomass</div><div><br></div><div><br></div><div>plot7 <- ggplot(d, aes(x = AGB, y = CTM/1000, col = grain, group = grain,colour=d[,"grain"], shape=d[,"grain"],linetype=d[,"grain"])) +</div><div>  geom_point(size = 3) + </div><div>  geom_smooth(method = "lm", group = d$grain, se = F) +</div><div>  stat_smooth(method="lm")+</div><div>  ylab(lb1) +</div><div>  xlab(lb2) +</div><div>  scale_y_continuous(limits = c(0, 400)) +</div><div>  labs(colour = "grain", shape="grain",linetype="grain") + </div><div>  guides(colour = guide_legend(title="Type of grain"), </div><div>         linetype=guide_legend(title="Type of grain"),</div><div>         shape=guide_legend(title="Type of grain")) +</div><div>  scale_shape_manual(values = c(15,16,17)) + </div><div>  scale_colour_manual(values = c("black","red","blue"))+</div><div>  scale_linetype_manual(values=c("dashed","solid","dotted"))+</div><div>  theme_bw() + theme_classic()+ theme(text=element_text(family="CM Roman", face="bold")) +</div><div>  theme(axis.text=element_text(size=18),axis.title=element_text(size=18),</div><div>        legend.text=element_text(size=16),legend.title=element_text(size=14))+</div><div>  theme(legend.justification = 'right', legend.position=c(0.29,0.85))</div><div><br></div><div>plot7 #+ annotate("text", x = 0.4, y = 370, label = "Intercept test\np - value\n0.00438",size=6,family="CM Roman")</div></div><div><br></div><div>Após rodar o script aparece a seguinte mensagem</div></div><div><b>(Warning message:The plyr::rename operation has created duplicates for the following name(s): (`colour`) > plot7 #+ annotate("text", x = 0.4, y = 370, label = "Intercept test\np - value\n0.00438",size=6,family="CM Roman")</b></div><div><b>Error: Aesthetics must be either length 1 or the same as the data (240): group.</b></div><div><b><br></b></div><div><b>Desde já agradeço qualquer comentário, abr</b></div><div><b>Gabriel Ribeiro</b></div></div>