我想使用 ggimage 包将从网页(LeBron_James 分配在下面)中提取的图像添加到 ggplot 中。如何将它添加到下面的 ggplot rscript?
GGplot_mean_performance <- FirstPick_Wage_Performance %>%
ggplot(aes(x=Player, y=mean_performance, label=mean_performance))+
geom_point(stat="identity", size=3) +
geom_hline(aes(yintercept = mean(mean_performance)), color = "blue", size = 3) +
geom_segment(aes(y = mean(mean_performance),
x = Player,
yend = mean_performance,
xend = Player,)) +
geom_text(color="red", size=4) +
labs(title="Lollipop Chart of Player's mean performance for the first two years as draft pick \ncompared to mean performance of the population",
subtitle="Blake Griffin is the best performing 1st Pick and Anthony Bennett is the worst performing 1st Pick",
caption="Source: https://www.basketball-reference.com & https://basketball.realgm.com") +
ylim(20, 80) +
coord_flip() +
theme(legend.position = "none")
Lebron_James <- image_read2("https://nba-players.herokuapp.com/players/james/lebron")