I would like
- to assign the category of "energetic level" COLORS in the red shades to the higher levels and in green shades to the lower ones.
- to order the SIZE of each point of the category "functional level"in the following order low_TL, inter_TL, Myrmecophage, mesocarnivores, large_species, apex carnivores, megafauna (assign to "low_TL" the smaller points size and to megafauna the biggest).
Dataset<-read.csv(file= "meat.csv", header= TRUE, sep= ";" )
library(ggplot2)
options(scipen=999)
theme_set(theme_bw())
gg <- ggplot(Dataset, aes(x=specie, y=responserate))+
geom_point(aes(col=energetic_level, size=functional_level)) +
geom_smooth(method="loess", se=F) +
labs(subtitle="Bushmeat trade",
y="Response rate",
x="Body mass")
gg+scale_color_gradient(low="green", high="red", space ="Lab" )
plot(gg)
specie responserate energetic_level functional_level
AAOtol_cras 7.2 2.4 low_TL
ABMiop_tal 1.6 3 low_TL
ACCLep_cap 14.4 3 low_TL
BAThry_swin 20 2.8 low_TL
BBPhil_mont 20.8 2.6 low_TL
BCChlor_cyn 72.8 3.2 low_TL
BDCerc_mit 5.6 2.5 low_TL
CCHys_afri 23.2 2.8 low_TL
FCan_mes 1.6 4.9 inter_TL
PTrag_oryx 16 2.7 low_TL
CBCivet_civ 43.2 4.4 inter_TL
DSylv_grim 48 3.1 inter_TL
IOryct_afer 11.2 5 Myrmecophage
ADGenet_gen 0 5.8 mesocarnivores
CALept_serv 0.8 5.8 mesocarnivores
ELyc_pict 0.8 5.8 mesocarnivores
GTrag_scri 100 3 large_species
JRed_aru 100 3 large_species
MPota_larv 100 3.2 large_species
OHipp_eq 14.4 3 large_species
QSync_caf 81.6 3 large_species
HPant_pa 18.4 6 apex carnivores
LCroc_croc 0 6 apex carnivores
NPant_le 0 6 apex carnivores
RHipp_amph 22.4 3 megafauna
SLox_afric 1.6 3 megafauna