- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我对此很陌生,实际上我并不理解绘图方法之间的差异,但是考虑到我有一个小尺寸的图表,loess
似乎给了我最丰富的信息。数据集(n=~300)。我正在尝试使用 facet_wrap
按性别拆分数据,而 loess
对于男性来说效果很好,但对于女性则不然。
这是我用来绘制图表的代码:
ggplot(data = df, aes(x = STM, y = ATTRACTcomp, color=Harasser_Attractiveness)) +
geom_point(position="jitter", size=0.5) +
facet_wrap( ~Participant_Gender,
labeller = as_labeller(c("Female" = "Female Participants", "Male" = "Male Participants"))) +
geom_smooth(method = "loess") +
labs(title = paste(strwrap("Interaction of Harasser Attractiveness, Participant Gender
and SOI on Attraction/Flattery", 50), collapse="\n"),
x = "Participant Short-term Mating Orientation", y = "Participant Attraction/Flattery",
color="Harasser:") +
theme(plot.title = element_text(hjust = 0.5),
plot.caption = element_text(hjust=0, margin=margin(t=15,0,0,0)),
legend.position="top", legend.margin = margin(1,0,0,0), legend.title = element_text(size=10),
legend.text = element_text(size=9), legend.key.size=unit(c(12), "pt")) +
scale_color_grey(start = .6, end = .1)
问题是我得到了男性图的平滑条件平均线,但没有得到女性图的平滑条件平均线。
这是我的错误消息:
Warning messages:
1: In simpleLoess(y, x, w, span, degree = degree, parametric = parametric, :
at 0.97
2: In simpleLoess(y, x, w, span, degree = degree, parametric = parametric, :
radius 0.0009
3: In simpleLoess(y, x, w, span, degree = degree, parametric = parametric, :
all data on boundary of neighborhood. make span bigger
4: In simpleLoess(y, x, w, span, degree = degree, parametric = parametric, :
pseudoinverse used at 0.97
5: In simpleLoess(y, x, w, span, degree = degree, parametric = parametric, :
neighborhood radius 0.03
6: In simpleLoess(y, x, w, span, degree = degree, parametric = parametric, :
reciprocal condition number 1
7: In simpleLoess(y, x, w, span, degree = degree, parametric = parametric, :
zero-width neighborhood. make span bigger
8: In simpleLoess(y, x, w, span, degree = degree, parametric = parametric, :
There are other near singularities as well. 1
9: Computation failed in `stat_smooth()`:
NA/NaN/Inf in foreign function call (arg 5)
有趣的是,对于多个 y 变量,这种情况会发生:女性图总是缺少线条,而且我总是遇到类似的错误。当我忽略facet_wrap并尝试只绘制只有女性参与者的数据帧的子集时,也会发生这种情况。
根据我对类似错误消息的阅读线程的了解,geom_smooth
(或stat_smooth
,因为我认为它在幕后被称为)中的一些计算返回无限值。 (我相当确定这里的相关变量中没有 NA
s/NaN
s。)问题是,有关此错误的所有线程都假设您有权访问这个过程产生了无限的值(value),而我却没有。
有些人一直在说,当您的值正好等于 1 时,就会发生这种情况。我确实有很多 ATTRACTcomp
(我的 y 变量)值正好等于 1,但它们都是男人和女人,所以我不知道为什么我能够得到男性的正确台词,但不能得到女性的正确台词。
同样提供信息的替代绘图方法也会有所帮助。
我不确定重现此错误所需的最小数据量是多少,因此我将包含一个仅包含图表中使用的变量的数据框:
> dput(df)
structure(list(STM = c(6L, 4L, 7L, 3L, 6L, 7L, 3L, 1L, 4L, 6L,
1L, 1L, 6L, 4L, 6L, 3L, 5L, 2L, 5L, 5L, 4L, 1L, 1L, 4L, 4L, 1L,
1L, 2L, 3L, 4L, 3L, 4L, 6L, 6L, 1L, 1L, 1L, 5L, 1L, 1L, 2L, 4L,
2L, 1L, 1L, 1L, 1L, 1L, 2L, 4L, 7L, 2L, 1L, 6L, 4L, 1L, 1L, 1L,
1L, 1L, 4L, 1L, 4L, 5L, 1L, 1L, 7L, 4L, 1L, 1L, 1L, 1L, 2L, 1L,
1L, 1L, 2L, 1L, 1L, 1L, 4L, 1L, 1L, 2L, 1L, 1L, 2L, 4L, 5L, 1L,
1L, 1L, 1L, 4L, 1L, 2L, 1L, 7L, 5L, 4L, 1L, 1L, 1L, 1L, 1L, 4L,
1L, 1L, 1L, 1L, 1L, 1L, 2L, 1L, 1L, 1L, 1L, 1L, 2L, 1L, 1L, 1L,
7L, 3L, 1L, 1L, 1L, 1L, 7L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L,
1L, 2L, 5L, 1L, 1L, 1L, 1L, 1L, 1L, 3L, 1L, 1L, 1L, 1L, 1L, 1L,
1L, 1L, 1L, 1L, 1L, 1L, 1L, 7L, 1L, 2L, 1L, 1L, 1L, 1L, 2L, 1L,
1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 2L, 5L, 1L, 1L, 1L, 1L, 1L, 1L,
1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 2L, 5L, 5L, 4L, 1L, 1L,
1L, 1L, 1L, 2L, 1L, 7L, 1L, 2L, 2L, 1L, 1L, 1L, 1L, 1L, 5L, 2L,
1L, 1L, 6L, 2L, 1L, 1L, 1L, 1L, 5L, 2L, 1L, 1L, 1L, 1L, 4L, 1L,
1L, 1L, 1L, 1L, 2L, 4L, 1L, 1L, 1L, 6L, 1L, 1L, 1L, 3L, 1L, 1L,
1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 3L, 1L, 1L, 1L, 1L, 1L,
4L, 5L, 5L, 1L, 1L, 4L, 4L, 1L, 7L, 1L, 1L, 4L, 3L, 1L, 1L, 1L,
1L, 1L, 1L, 2L, 2L, 5L, 1L, 1L, 1L, 1L, 5L, 2L, 1L, 4L, 7L, 1L,
1L, 2L, 1L, 1L, 4L, 5L, 5L, 2L, 1L, 4L, 7L, 3L, 5L, 4L, 5L, 4L,
5L, 7L, 7L, 3L), ATTRACTcomp = c(6.53125, 4.25, 5.84375, 4.21875,
5.4375, 2.15625, 3.96875, 4.71875, 3.875, 5.875, 2, 1.87096774193548,
5.65625, 4.5625, 5.65625, 4.53125, 5.375, 1, 5.125, 3.5625, 4.71875,
3.96875, 4.03125, 4.15625, 4.28125, 4.6875, 3.53125, 2.40625,
4.15625, 2.8125, 4.54838709677419, 3.40625, 4.09677419354839,
4.625, 4.53125, 1.90625, 2.32258064516129, 3.53125, 1.90625,
3.46666666666667, 2.2258064516129, 3.625, 4.40625, 4.625, 2.125,
4.3125, 1.9375, 2.4375, 3.96875, 4.875, 5.16129032258065, 2.1875,
1.0625, 3.34375, 3.40625, 1.90625, 1, 3.75, 3.45161290322581,
1.93548387096774, 3.53125, 1.84375, 2.71875, 3.40625, 2.59375,
4.09375, 4.125, 3.96875, 4.34375, 1, 2.6875, 3.6875, 1.09375,
1.0625, 1.375, 1.96875, 2.25, 1.28125, 1.03125, 3.8125, 4.0625,
2.09375, 1.25, 2.34375, 2.90625, 1, 1.5625, 1.25, 1.5625, 1.34375,
2.46875, 1.96875, 1.15625, 1.59375, 1.09375, 2.03125, 1, 5.40625,
3.59375, 1.1875, 1.90625, 1.8125, 1.56666666666667, 1.0625, 3.58064516129032,
4.90625, 6.28125, 1.0625, 2.9375, 1.09375, 1.78125, 1, 2.09375,
1.03125, 4.75, 2.71875, 1, 5.96875, 1.42307692307692, 1, 1.0625,
1.0625, 1.03125, 1.90625, 1.28125, 1.15625, 1.03125, 1.09375,
6.53125, 2.15625, 1.03125, 1.59375, 2, 1.1875, 1.1875, 1.34375,
2.25, 1.03125, 1.0625, 1.3125, 1, 1.5, 1, 2.375, 1.1875, 1.0625,
1.35483870967742, 1, 1.09375, 1.15625, 1, 1, 1.5625, 2, 1, 1.03125,
1.03125, 1, 1.125, 1, 6.6875, 1.1875, 1.51612903225806, 1.0625,
1.125, 1, 1.15625, 1.4375, 1.25, 1.0625, 1.03125, 1.41935483870968,
1, 1, 2.09375, 1.15625, 1, 1, 1, 3.06451612903226, 1, 1, 1, 1,
1, 1, 1, 1.03125, 1.1875, 1.875, 1, 1, 1.5625, 3.25, 1.3125,
1.46875, 2.375, 3.78125, 3.25, 1.21875, 1.25, 1, 1.65625, 1,
1, 6.0625, 1.90625, 6.80645161290323, 1.21875, 1.65625, 1, 1.28125,
1.26666666666667, 1.03125, 1, 2.3125, 4.125, 3.59375, 2.40625,
5.34375, 4.84375, 3.65625, 1.28125, 1.5625, 3.6875, 1.53125,
1.09375, 1.21875, 2.15625, 1.25, 1, 1.375, 1.3125, 1.125, 1.5625,
1.25, 1.5, 1.28125, 2.21875, 3.09375, 3.15625, 1, 1.15625, 4.75,
1, 1.61290322580645, 1.90322580645161, 1.74193548387097, 1.46875,
1, 1.1875, 1.1875, 1.03125, 1.34375, 1.78125, 1, 1.8125, 1, 1,
1.2258064516129, 1.0625, 1.25, 1.59375, 1.09375, 1, 1.03125,
3.9375, 1.46875, 2.71875, 7, 3.875, 3.40625, 2.4375, 2.53125,
2.09677419354839, 1.28125, 1, 1.8125, 1, 1.78125, 1.0625, 1,
1, 1.03125, 1.09375, 1.4375, 1, 1.625, 1.03125, 1.03125, 1.40625,
1.84375, 3.40625, 3.21875, 1, 1, 6.6875, 2.71875, 2.5625, 3.96875,
2.8125, 2.125, 4.21875, 3.65625, 3.25, 1.53125, 5.8125, 3.5625,
4.78125, 1.625, 5.875, 3.21875, 3.41935483870968, 3.21875, 6,
6.34375, 6, 1.40625), Harasser_Attractiveness = structure(c(1L,
1L, 1L, 2L, 1L, 1L, 2L, 2L, 2L, 1L, 1L, 1L, 2L, 1L, 2L, 2L, 2L,
2L, 2L, 1L, 2L, 2L, 2L, 2L, 1L, 2L, 1L, 2L, 2L, 1L, 1L, 2L, 2L,
2L, 1L, 1L, 2L, 2L, 2L, 1L, 2L, 1L, 1L, 1L, 2L, 2L, 2L, 1L, 1L,
2L, 1L, 2L, 2L, 1L, 2L, 1L, 2L, 2L, 1L, 1L, 1L, 1L, 2L, 1L, 2L,
2L, 1L, 1L, 1L, 1L, 2L, 1L, 2L, 2L, 2L, 1L, 1L, 2L, 1L, 1L, 2L,
1L, 2L, 1L, 2L, 2L, 2L, 1L, 2L, 1L, 1L, 1L, 2L, 1L, 2L, 1L, 2L,
1L, 1L, 1L, 1L, 2L, 2L, 2L, 1L, 1L, 1L, 1L, 2L, 2L, 1L, 1L, 1L,
2L, 2L, 1L, 1L, 1L, 1L, 2L, 2L, 1L, 2L, 2L, 2L, 1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, 2L, 2L, 2L, 2L, 1L, 2L, 2L, 2L), .Label = c("Female",
"Male"), class = "factor")), .Names = c("STM", "ATTRACTcomp",
"Harasser_Attractiveness", "Participant_Gender"), row.names = c(NA,
-318L), class = "data.frame")
最佳答案
如noted by joran ,我认为您的数据过于倾斜,无法适应这种平滑功能。对于如此不平衡的数据,我会重新考虑使用此方法,因此集中于 STM == 1
。可以让它显示一些行,例如下面通过删除 STM == 1
的前 50 个女性观察结果,但这并不是离散 x 轴的真正正确显示(即使理论上,变量是连续的,您的实际数据是离散的)。事实上,平滑的线条具有误导性(女性线条是否真的在 STM == 7
处下降,或者真的只是因为那里只有两个点?
我更喜欢如下的箱线图方法,在 aes()
调用中使用 factor(STM)
。在这里,我们可以使用 geom_text
在图表底部添加箱线图的计数,从而更清楚地了解每个箱线图的基础。我们仍然大致了解,较高的 STM
与较高的 ATTRACTComp
相关,随 Harasser_Attractiveness
的变化而变化,但我们不再建议基于平滑关系线基于很少的数据点。
library(tidyverse)
df <- structure(list(STM = c(6L, 4L, 7L, 3L, 6L, 7L, 3L, 1L, 4L, 6L,
1L, 1L, 6L, 4L, 6L, 3L, 5L, 2L, 5L, 5L, 4L, 1L, 1L, 4L, 4L, 1L,
1L, 2L, 3L, 4L, 3L, 4L, 6L, 6L, 1L, 1L, 1L, 5L, 1L, 1L, 2L, 4L,
2L, 1L, 1L, 1L, 1L, 1L, 2L, 4L, 7L, 2L, 1L, 6L, 4L, 1L, 1L, 1L,
1L, 1L, 4L, 1L, 4L, 5L, 1L, 1L, 7L, 4L, 1L, 1L, 1L, 1L, 2L, 1L,
1L, 1L, 2L, 1L, 1L, 1L, 4L, 1L, 1L, 2L, 1L, 1L, 2L, 4L, 5L, 1L,
1L, 1L, 1L, 4L, 1L, 2L, 1L, 7L, 5L, 4L, 1L, 1L, 1L, 1L, 1L, 4L,
1L, 1L, 1L, 1L, 1L, 1L, 2L, 1L, 1L, 1L, 1L, 1L, 2L, 1L, 1L, 1L,
7L, 3L, 1L, 1L, 1L, 1L, 7L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L,
1L, 2L, 5L, 1L, 1L, 1L, 1L, 1L, 1L, 3L, 1L, 1L, 1L, 1L, 1L, 1L,
1L, 1L, 1L, 1L, 1L, 1L, 1L, 7L, 1L, 2L, 1L, 1L, 1L, 1L, 2L, 1L,
1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 2L, 5L, 1L, 1L, 1L, 1L, 1L, 1L,
1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 2L, 5L, 5L, 4L, 1L, 1L,
1L, 1L, 1L, 2L, 1L, 7L, 1L, 2L, 2L, 1L, 1L, 1L, 1L, 1L, 5L, 2L,
1L, 1L, 6L, 2L, 1L, 1L, 1L, 1L, 5L, 2L, 1L, 1L, 1L, 1L, 4L, 1L,
1L, 1L, 1L, 1L, 2L, 4L, 1L, 1L, 1L, 6L, 1L, 1L, 1L, 3L, 1L, 1L,
1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 3L, 1L, 1L, 1L, 1L, 1L,
4L, 5L, 5L, 1L, 1L, 4L, 4L, 1L, 7L, 1L, 1L, 4L, 3L, 1L, 1L, 1L,
1L, 1L, 1L, 2L, 2L, 5L, 1L, 1L, 1L, 1L, 5L, 2L, 1L, 4L, 7L, 1L,
1L, 2L, 1L, 1L, 4L, 5L, 5L, 2L, 1L, 4L, 7L, 3L, 5L, 4L, 5L, 4L,
5L, 7L, 7L, 3L), ATTRACTcomp = c(6.53125, 4.25, 5.84375, 4.21875,
5.4375, 2.15625, 3.96875, 4.71875, 3.875, 5.875, 2, 1.87096774193548,
5.65625, 4.5625, 5.65625, 4.53125, 5.375, 1, 5.125, 3.5625, 4.71875,
3.96875, 4.03125, 4.15625, 4.28125, 4.6875, 3.53125, 2.40625,
4.15625, 2.8125, 4.54838709677419, 3.40625, 4.09677419354839,
4.625, 4.53125, 1.90625, 2.32258064516129, 3.53125, 1.90625,
3.46666666666667, 2.2258064516129, 3.625, 4.40625, 4.625, 2.125,
4.3125, 1.9375, 2.4375, 3.96875, 4.875, 5.16129032258065, 2.1875,
1.0625, 3.34375, 3.40625, 1.90625, 1, 3.75, 3.45161290322581,
1.93548387096774, 3.53125, 1.84375, 2.71875, 3.40625, 2.59375,
4.09375, 4.125, 3.96875, 4.34375, 1, 2.6875, 3.6875, 1.09375,
1.0625, 1.375, 1.96875, 2.25, 1.28125, 1.03125, 3.8125, 4.0625,
2.09375, 1.25, 2.34375, 2.90625, 1, 1.5625, 1.25, 1.5625, 1.34375,
2.46875, 1.96875, 1.15625, 1.59375, 1.09375, 2.03125, 1, 5.40625,
3.59375, 1.1875, 1.90625, 1.8125, 1.56666666666667, 1.0625, 3.58064516129032,
4.90625, 6.28125, 1.0625, 2.9375, 1.09375, 1.78125, 1, 2.09375,
1.03125, 4.75, 2.71875, 1, 5.96875, 1.42307692307692, 1, 1.0625,
1.0625, 1.03125, 1.90625, 1.28125, 1.15625, 1.03125, 1.09375,
6.53125, 2.15625, 1.03125, 1.59375, 2, 1.1875, 1.1875, 1.34375,
2.25, 1.03125, 1.0625, 1.3125, 1, 1.5, 1, 2.375, 1.1875, 1.0625,
1.35483870967742, 1, 1.09375, 1.15625, 1, 1, 1.5625, 2, 1, 1.03125,
1.03125, 1, 1.125, 1, 6.6875, 1.1875, 1.51612903225806, 1.0625,
1.125, 1, 1.15625, 1.4375, 1.25, 1.0625, 1.03125, 1.41935483870968,
1, 1, 2.09375, 1.15625, 1, 1, 1, 3.06451612903226, 1, 1, 1, 1,
1, 1, 1, 1.03125, 1.1875, 1.875, 1, 1, 1.5625, 3.25, 1.3125,
1.46875, 2.375, 3.78125, 3.25, 1.21875, 1.25, 1, 1.65625, 1,
1, 6.0625, 1.90625, 6.80645161290323, 1.21875, 1.65625, 1, 1.28125,
1.26666666666667, 1.03125, 1, 2.3125, 4.125, 3.59375, 2.40625,
5.34375, 4.84375, 3.65625, 1.28125, 1.5625, 3.6875, 1.53125,
1.09375, 1.21875, 2.15625, 1.25, 1, 1.375, 1.3125, 1.125, 1.5625,
1.25, 1.5, 1.28125, 2.21875, 3.09375, 3.15625, 1, 1.15625, 4.75,
1, 1.61290322580645, 1.90322580645161, 1.74193548387097, 1.46875,
1, 1.1875, 1.1875, 1.03125, 1.34375, 1.78125, 1, 1.8125, 1, 1,
1.2258064516129, 1.0625, 1.25, 1.59375, 1.09375, 1, 1.03125,
3.9375, 1.46875, 2.71875, 7, 3.875, 3.40625, 2.4375, 2.53125,
2.09677419354839, 1.28125, 1, 1.8125, 1, 1.78125, 1.0625, 1,
1, 1.03125, 1.09375, 1.4375, 1, 1.625, 1.03125, 1.03125, 1.40625,
1.84375, 3.40625, 3.21875, 1, 1, 6.6875, 2.71875, 2.5625, 3.96875,
2.8125, 2.125, 4.21875, 3.65625, 3.25, 1.53125, 5.8125, 3.5625,
4.78125, 1.625, 5.875, 3.21875, 3.41935483870968, 3.21875, 6,
6.34375, 6, 1.40625), Harasser_Attractiveness = structure(c(1L,
1L, 1L, 2L, 1L, 1L, 2L, 2L, 2L, 1L, 1L, 1L, 2L, 1L, 2L, 2L, 2L,
2L, 2L, 1L, 2L, 2L, 2L, 2L, 1L, 2L, 1L, 2L, 2L, 1L, 1L, 2L, 2L,
2L, 1L, 1L, 2L, 2L, 2L, 1L, 2L, 1L, 1L, 1L, 2L, 2L, 2L, 1L, 1L,
2L, 1L, 2L, 2L, 1L, 2L, 1L, 2L, 2L, 1L, 1L, 1L, 1L, 2L, 1L, 2L,
2L, 1L, 1L, 1L, 1L, 2L, 1L, 2L, 2L, 2L, 1L, 1L, 2L, 1L, 1L, 2L,
1L, 2L, 1L, 2L, 2L, 2L, 1L, 2L, 1L, 1L, 1L, 2L, 1L, 2L, 1L, 2L,
1L, 1L, 1L, 1L, 2L, 2L, 2L, 1L, 1L, 1L, 1L, 2L, 2L, 1L, 1L, 1L,
2L, 2L, 1L, 1L, 1L, 1L, 2L, 2L, 1L, 2L, 2L, 2L, 1L, 2L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 2L, 2L, 2L, 1L, 2L, 2L, 2L), .Label = c("Female",
"Male"), class = "factor")), .Names = c("STM", "ATTRACTcomp",
"Harasser_Attractiveness", "Participant_Gender"), row.names = c(NA,
-318L), class = "data.frame")
ggplot(
data = df %>%
arrange(Participant_Gender, STM) %>%
slice(50:nrow(.)),
mapping = aes(x = STM, y = ATTRACTcomp, color = Harasser_Attractiveness)
) +
geom_jitter() +
geom_smooth() +
facet_wrap(~ Participant_Gender,
labeller = as_labeller(c("Female" = "Female Participants", "Male" = "Male Participants"))
) +
labs(
title = paste(strwrap("Interaction of Harasser Attractiveness, Participant Gender
and SOI on Attraction/Flattery", 50), collapse = "\n"),
x = "Participant Short-term Mating Orientation",
y = "Participant Attraction/Flattery",
color = "Harasser:"
) +
theme(
plot.title = element_text(hjust = 0.5),
plot.caption = element_text(hjust = 0, margin = margin(t = 15, 0, 0, 0)),
legend.position = "top",
legend.margin = margin(1, 0, 0, 0),
legend.title = element_text(size = 10),
legend.text = element_text(size = 9),
legend.key.size = unit(c(12), "pt")
)
#> `geom_smooth()` using method = 'loess' and formula 'y ~ x'
#> Warning in simpleLoess(y, x, w, span, degree = degree, parametric =
#> parametric, : pseudoinverse used at 0.97
#> Warning in simpleLoess(y, x, w, span, degree = degree, parametric =
#> parametric, : neighborhood radius 1.03
#> Warning in simpleLoess(y, x, w, span, degree = degree, parametric =
#> parametric, : reciprocal condition number 0
#> Warning in simpleLoess(y, x, w, span, degree = degree, parametric =
#> parametric, : There are other near singularities as well. 1
#> Warning in predLoess(object$y, object$x, newx = if
#> (is.null(newdata)) object$x else if (is.data.frame(newdata))
#> as.matrix(model.frame(delete.response(terms(object)), : pseudoinverse used
#> at 0.97
#> Warning in predLoess(object$y, object$x, newx = if
#> (is.null(newdata)) object$x else if (is.data.frame(newdata))
#> as.matrix(model.frame(delete.response(terms(object)), : neighborhood radius
#> 1.03
#> Warning in predLoess(object$y, object$x, newx = if
#> (is.null(newdata)) object$x else if (is.data.frame(newdata))
#> as.matrix(model.frame(delete.response(terms(object)), : reciprocal
#> condition number 0
#> Warning in predLoess(object$y, object$x, newx = if
#> (is.null(newdata)) object$x else if (is.data.frame(newdata))
#> as.matrix(model.frame(delete.response(terms(object)), : There are other
#> near singularities as well. 1
#> Warning in simpleLoess(y, x, w, span, degree = degree, parametric =
#> parametric, : pseudoinverse used at 0.97
#> Warning in simpleLoess(y, x, w, span, degree = degree, parametric =
#> parametric, : neighborhood radius 2.03
#> Warning in simpleLoess(y, x, w, span, degree = degree, parametric =
#> parametric, : reciprocal condition number 0
#> Warning in simpleLoess(y, x, w, span, degree = degree, parametric =
#> parametric, : There are other near singularities as well. 4
#> Warning in predLoess(object$y, object$x, newx = if
#> (is.null(newdata)) object$x else if (is.data.frame(newdata))
#> as.matrix(model.frame(delete.response(terms(object)), : pseudoinverse used
#> at 0.97
#> Warning in predLoess(object$y, object$x, newx = if
#> (is.null(newdata)) object$x else if (is.data.frame(newdata))
#> as.matrix(model.frame(delete.response(terms(object)), : neighborhood radius
#> 2.03
#> Warning in predLoess(object$y, object$x, newx = if
#> (is.null(newdata)) object$x else if (is.data.frame(newdata))
#> as.matrix(model.frame(delete.response(terms(object)), : reciprocal
#> condition number 0
#> Warning in predLoess(object$y, object$x, newx = if
#> (is.null(newdata)) object$x else if (is.data.frame(newdata))
#> as.matrix(model.frame(delete.response(terms(object)), : There are other
#> near singularities as well. 4
ggplot(
data = df,
mapping = aes(x = factor(STM), y = ATTRACTcomp, color = Harasser_Attractiveness)
) +
geom_boxplot() +
facet_wrap(
~ Participant_Gender,
labeller = as_labeller(c("Female" = "Female Participants", "Male" = "Male Participants"))
) +
geom_text(
data = df %>%
count(Participant_Gender, STM, Harasser_Attractiveness) %>%
mutate(label = str_c(n), yloc = 0.75),
mapping = aes(y = yloc, label = label),
position = position_dodge(width = 0.75)
) +
labs(
title = paste(strwrap("Interaction of Harasser Attractiveness, Participant Gender
and SOI on Attraction/Flattery", 50), collapse = "\n"),
x = "Participant Short-term Mating Orientation",
y = "Participant Attraction/Flattery",
color = "Harasser:"
) +
theme(
plot.title = element_text(hjust = 0.5),
plot.caption = element_text(hjust = 0, margin = margin(t = 15, 0, 0, 0)),
legend.position = "top",
legend.margin = margin(1, 0, 0, 0),
legend.title = element_text(size = 10),
legend.text = element_text(size = 9),
legend.key.size = unit(c(12), "pt")
)
由reprex package于2018年4月16日创建(v0.2.0)。
关于r - 使用 ggplot2 geom_smooth method=loess 绘制数据是否困难?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49866476/
我在网上搜索但没有找到任何合适的文章解释如何使用 javascript 使用 WCF 服务,尤其是 WebScriptEndpoint。 任何人都可以对此给出任何指导吗? 谢谢 最佳答案 这是一篇关于
我正在编写一个将运行 Linux 命令的 C 程序,例如: cat/etc/passwd | grep 列表 |剪切-c 1-5 我没有任何结果 *这里 parent 等待第一个 child (chi
所以我正在尝试处理文件上传,然后将该文件作为二进制文件存储到数据库中。在我存储它之后,我尝试在给定的 URL 上提供文件。我似乎找不到适合这里的方法。我需要使用数据库,因为我使用 Google 应用引
我正在尝试制作一个宏,将下面的公式添加到单元格中,然后将其拖到整个列中并在 H 列中复制相同的公式 我想在 F 和 H 列中输入公式的数据 Range("F1").formula = "=IF(ISE
问题类似于this one ,但我想使用 OperatorPrecedenceParser 解析带有函数应用程序的表达式在 FParsec . 这是我的 AST: type Expression =
我想通过使用 sequelize 和 node.js 将这个查询更改为代码取决于在哪里 select COUNT(gender) as genderCount from customers where
我正在使用GNU bash,版本5.0.3(1)-发行版(x86_64-pc-linux-gnu),我想知道为什么简单的赋值语句会出现语法错误: #/bin/bash var1=/tmp
这里,为什么我的代码在 IE 中不起作用。我的代码适用于所有浏览器。没有问题。但是当我在 IE 上运行我的项目时,它发现错误。 而且我的 jquery 类和 insertadjacentHTMl 也不
我正在尝试更改标签的innerHTML。我无权访问该表单,因此无法编辑 HTML。标签具有的唯一标识符是“for”属性。 这是输入和标签的结构:
我有一个页面,我可以在其中返回用户帖子,可以使用一些 jquery 代码对这些帖子进行即时评论,在发布新评论后,我在帖子下插入新评论以及删除 按钮。问题是 Delete 按钮在新插入的元素上不起作用,
我有一个大约有 20 列的“管道分隔”文件。我只想使用 sha1sum 散列第一列,它是一个数字,如帐号,并按原样返回其余列。 使用 awk 或 sed 执行此操作的最佳方法是什么? Accounti
我需要将以下内容插入到我的表中...我的用户表有五列 id、用户名、密码、名称、条目。 (我还没有提交任何东西到条目中,我稍后会使用 php 来做)但由于某种原因我不断收到这个错误:#1054 - U
所以我试图有一个输入字段,我可以在其中输入任何字符,但然后将输入的值小写,删除任何非字母数字字符,留下“。”而不是空格。 例如,如果我输入: 地球的 70% 是水,-!*#$^^ & 30% 土地 输
我正在尝试做一些我认为非常简单的事情,但出于某种原因我没有得到想要的结果?我是 javascript 的新手,但对 java 有经验,所以我相信我没有使用某种正确的规则。 这是一个获取输入值、检查选择
我想使用 angularjs 从 mysql 数据库加载数据。 这就是应用程序的工作原理;用户登录,他们的用户名存储在 cookie 中。该用户名显示在主页上 我想获取这个值并通过 angularjs
我正在使用 autoLayout,我想在 UITableViewCell 上放置一个 UIlabel,它应该始终位于单元格的右侧和右侧的中心。 这就是我想要实现的目标 所以在这里你可以看到我正在谈论的
我需要与 MySql 等效的 elasticsearch 查询。我的 sql 查询: SELECT DISTINCT t.product_id AS id FROM tbl_sup_price t
我正在实现代码以使用 JSON。 func setup() { if let flickrURL = NSURL(string: "https://api.flickr.com/
我尝试使用for循环声明变量,然后测试cols和rols是否相同。如果是,它将运行递归函数。但是,我在 javascript 中执行 do 时遇到问题。有人可以帮忙吗? 现在,在比较 col.1 和
我举了一个我正在处理的问题的简短示例。 HTML代码: 1 2 3 CSS 代码: .BB a:hover{ color: #000; } .BB > li:after {
我是一名优秀的程序员,十分优秀!