示例数据如下:
library(tidyverse)
df=tibble(type=c('grass','forest','desert','crop'),
temperature=c(0.6206,0.6132,0.6235,0.6134),
precipitation=c(252,290,198,337),
radiation=c(156,177,123,205))
dff <- df %>% pivot_longer(cols = -type,
names_to = 'n',
values_to = 'v')
dff
ggplot(data = dff)+
geom_bar(aes(x=type,y=v,
fill=n),
stat = 'identity',
position = 'dodge')
问题是“温度”变量太低而无法观察到它!!! 我怎样才能做出更好的身材? 提前致谢!