如何将我的散点图转换为正确的散点图?
ggplot(satDf, aes(x=`Satisfaction Coefficient`, y=`Dissatisfaction Coefficient`)) + geom_point() + expand_limits(x=c(0.00, 1.00), y=c(0.00, -1.00))
satdf
“ https://i.sstatic.net/3nbju.png
"","Attribute","Satisfaction Coefficient","Dissatisfaction Coefficient"
"1","Create an enjoyable interaction","0.47","-0.43"
"2","Create an enjoyable interaction","0.38","-0.24"
"3","Create an enjoyable interaction","0.29","-0.17"
"4","Create an enjoyable interaction","0.49","-0.49"
"5","Create an enjoyable interaction","0.48","-0.36"
"6","Create an enjoyable interaction","0.36","-0.26"
"7","Create an enjoyable interaction","0.37","-0.4"
"8","Create an enjoyable interaction","0.32","-0.29"
"9","Create an enjoyable interaction","0.25","-0.16"
"10","Create an enjoyable interaction","0.61","-0.57"
"11","Create an enjoyable interaction","0.49","-0.49"
"12","Create an enjoyable interaction","0.08","-0.18"
>
structure(list(Attribute = c("Create an enjoyable interaction",
"Create an enjoyable interaction", "Create an enjoyable interaction",
"Create an enjoyable interaction", "Create an enjoyable interaction",
"Create an enjoyable interaction"), `Satisfaction Coefficient` = c("0.47",
"0.38", "0.29", "0.49", "0.48", "0.36"), `Dissatisfaction Coefficient` = c("-0.43",
"-0.24", "-0.17", "-0.49", "-0.36", "-0.26")), row.names = c(NA,
6L), class = "data.frame")
if(!require('ggplot2')) {
install.packages('ggplot2')
library('ggplot2')
}
satDf <- read.csv("")
ggplot(satDf, aes(x=`Satisfaction Coefficient`, y=`Dissatisfaction Coefficient`)) + geom_point(col="blue") + expand_limits(x=c(0.00, 1.00), y=c(0.00, -1.00)) + geom_text(label=rownames(satDf), nudge_x = -0.25, nudge_y = -0.25)
I'm new to r and I want to recreate this scatterplot:
But I don't know how to get there. This is the code I have at this moment:
ggplot(satDf, aes(x=`Satisfaction Coefficient`, y=`Dissatisfaction Coefficient`)) + geom_point() + expand_limits(x=c(0.00, 1.00), y=c(0.00, -1.00))
which results in the following:
satDf
CSV version of dataframe:
"","Attribute","Satisfaction Coefficient","Dissatisfaction Coefficient"
"1","Create an enjoyable interaction","0.47","-0.43"
"2","Create an enjoyable interaction","0.38","-0.24"
"3","Create an enjoyable interaction","0.29","-0.17"
"4","Create an enjoyable interaction","0.49","-0.49"
"5","Create an enjoyable interaction","0.48","-0.36"
"6","Create an enjoyable interaction","0.36","-0.26"
"7","Create an enjoyable interaction","0.37","-0.4"
"8","Create an enjoyable interaction","0.32","-0.29"
"9","Create an enjoyable interaction","0.25","-0.16"
"10","Create an enjoyable interaction","0.61","-0.57"
"11","Create an enjoyable interaction","0.49","-0.49"
"12","Create an enjoyable interaction","0.08","-0.18"
or
structure(list(Attribute = c("Create an enjoyable interaction",
"Create an enjoyable interaction", "Create an enjoyable interaction",
"Create an enjoyable interaction", "Create an enjoyable interaction",
"Create an enjoyable interaction"), `Satisfaction Coefficient` = c("0.47",
"0.38", "0.29", "0.49", "0.48", "0.36"), `Dissatisfaction Coefficient` = c("-0.43",
"-0.24", "-0.17", "-0.49", "-0.36", "-0.26")), row.names = c(NA,
6L), class = "data.frame")
if(!require('ggplot2')) {
install.packages('ggplot2')
library('ggplot2')
}
satDf <- read.csv("")
ggplot(satDf, aes(x=`Satisfaction Coefficient`, y=`Dissatisfaction Coefficient`)) + geom_point(col="blue") + expand_limits(x=c(0.00, 1.00), y=c(0.00, -1.00)) + geom_text(label=rownames(satDf), nudge_x = -0.25, nudge_y = -0.25)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您在寻找这样的东西吗?
Are you looking for something like this?