Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/r/78.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
R 镶嵌面环绕(缩放)和缩放y连续(标签、打断)之间的冲突_R_Ggplot2 - Fatal编程技术网

R 镶嵌面环绕(缩放)和缩放y连续(标签、打断)之间的冲突

R 镶嵌面环绕(缩放)和缩放y连续(标签、打断)之间的冲突,r,ggplot2,R,Ggplot2,让有一个数据帧 库(tidyverse) 日期%as.integer()) d%>%s() 似乎facet\u wrap和scale\u y\u continuous之间存在冲突。排除其中任何一个,我得到一个结果我能做些什么来留住他们吗? 如果没有scale\u y\u continuous()我知道了,但我真的需要百分比标签: 注:真实数据框约有200行,约30名受试者,约10个月,缺少一些组合。它仍在增长。您必须用以下内容替换scale\y\u continuous(labels=sca

让有一个数据帧

库(tidyverse)
日期%as.integer())
d%>%s()
似乎
facet\u wrap
scale\u y\u continuous
之间存在冲突。排除其中任何一个,我得到一个结果我能做些什么来留住他们吗?

如果没有
scale\u y\u continuous()
我知道了,但我真的需要百分比标签:


注:真实数据框约有200行,约30名受试者,约10个月,缺少一些组合。它仍在增长。

您必须用以下内容替换
scale\y\u continuous(labels=scales::percent,breaks=seq(0,1,2))

scale_y_continuous(labels = scales::percent_format(accuracy=2), breaks = seq(0, 1, .2))

您可以试试
labels=scales::percent\u format()
。或者
scales::percent\u format(精度=2)
。它可以工作。写一个我能接受的答案。它比我的
标签、断开
解决方案要好。谢谢
Error in prettyNum(.Internal(format(x, trim, digits, nsmall, width, 3L, : argument 'nsmall' incorrect
scale_y_continuous(labels = scales::percent_format(accuracy=2), breaks = seq(0, 1, .2))