我想通过定义一个新函数来将x轴缩放为立方正方形。
cuberoot_trans = function(){
trans = function(x) x^(1/3)
}
ggplot(data = diamonds, aes(x=carat, y=price)) +
geom_point(alpha=1.5, size=0.75, position = 'jitter') +
scale_x_continuous(breaks = c(0.2, 0.5, 1, 2, 3), limits = c(0.2, 3), trans = cuberoot_trans())
paste0(x,“ _trans”)中的错误: 无法将类型'closure'强制转换为类型'character'的向量
我在做什么错?