Skip to content

Instantly share code, notes, and snippets.

@MJacobs1985
Created February 21, 2022 14:59
Show Gist options
  • Save MJacobs1985/c5792fe8ace2c8c5a9f3cd2abe70a9f3 to your computer and use it in GitHub Desktop.
Save MJacobs1985/c5792fe8ace2c8c5a9f3cd2abe70a9f3 to your computer and use it in GitHub Desktop.
arc<-as.data.frame(arc)
arcraw<-as.data.frame(arcraw)
varPlot(form=rochefant~(region), Data=arc)
varPlot(form=rochefant~(customer), Data=arc) # some customers for sure provided more data then others
varPlot(form=rochefant~(locality), Data=arc)
varPlot(form=rochefant~(slaughteryear), Data=arc)
varPlot(rochefant~(slaughteryear+slaughtermonth), arc, keep.order = FALSE,
MeanLine=list(var=c("int", "slaughteryear"),
col=c("magenta", "blue"), lwd=c(2,2)))
varPlot(form=rochefant~(strain), Data=arc)
varPlot(form=rochefant~(weightclasshalv), Data=arc) # relationship between weight and pigmentation is not THAT direct
ggplot(data = arc,
aes(x = rochefant,
y = nirfat,
col = as.numeric(customer),
group = as.numeric(customer)))+ #to add the colours for different classes
geom_point(size = 1.2,alpha = .8,position = "jitter")+ #to add some random noise for plotting purposes
theme_minimal()+theme(legend.position = "none")+
scale_color_gradientn(colours = rainbow(100))+
geom_smooth(method = lm, se = FALSE,size = .5, alpha = .8) + # to add regression line
labs(title = "Pigmentation & NirFat",
subtitle = "add colours for different customers and regression lines")
ggplot(data = arc,
aes(x = rochefant,
y = nirfat,
col = as.factor(weightclasshalv))) +
geom_point(size= 1.2, alpha = .8, position = "jitter") + #to add some random noise for plotting purposes
theme_minimal() + theme(legend.position = "none") +
geom_smooth(method = lm, se = FALSE,size = .5, alpha = .8)
ggplot(data = arc,
aes(x = rochefant,
y = nirfat,
col = as.factor(slaughtermonth))) +
geom_point(size= 1.2, alpha = .3, position = "jitter") + #to add some random noise for plotting purposes
theme_minimal() + theme(legend.position = "none") +
geom_smooth(method = lm, se = FALSE,size = .5, alpha = .8)
ggplot(data = arc,
aes(x = rochefant,
y = nirfat,
col = as.factor(strain))) +
geom_point(size= 1.2, alpha = .3, position = "jitter") + #to add some random noise for plotting purposes
theme_minimal() + theme(legend.position = "none") +
geom_smooth(method = lm, se = FALSE,size = .5, alpha = .8)
ggplot(data = arc,
aes(x = rochefant,
y = `nir-ala`,
col = as.numeric(customer),
group = as.numeric(customer)))+
geom_point(size = 1.2,alpha = .8,position = "jitter")+
theme_minimal()+theme(legend.position = "none")+
scale_color_gradientn(colours = rainbow(100))+
geom_smooth(method = lm, se = FALSE,size = .5, alpha = .8)
ggplot(data = arc,
aes(x = rochefant,
y = arc$`nir-dha`,
col = as.numeric(customer),
group = as.numeric(customer)))+
geom_point(size = 1.2,alpha = .8,position = "jitter")+
theme_minimal()+theme(legend.position = "none")+
scale_color_gradientn(colours = rainbow(100))+
geom_smooth(method = lm, se = FALSE,size = .5, alpha = .8)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment