r - 如何在虚拟变量散点图上叠加拟合线?
问题描述
我试图在每个虚拟变量上画一条线,但不知道该怎么做?谁能指出我正确的方向?
# label points by ’type’ on scatterplot
> plot(education, prestige, pch=as.numeric(type), col=as.numeric(type))
# add a legend to the above plot
> legend(8,95, levels(type), pch=1:3, col=1:3)
解决方案
推荐阅读
- javascript - React:将 event.preventDefault() 方法添加到功能组件中
- jquery - 使用带有自定义回调/jquery 选择器的 sweetalert2
- linux - 在图形输出到达 linux 帧缓冲区之前拦截和转移图形输出,而不是使用 X11
- c# - C# 套接字客户端服务器断开连接
- python - 将 (n_samples, n_features) ndarray 转换为 (n_samples, 1) 向量数组以用作 sklearn SVM 的训练标签
- azure - 使用 facebook 记录的 Azure B2C 用户可以更改 profie 值
- python - 'method-wrapper' 对象在 AES CTR pycrypto 库中不可迭代
- javascript - 在javascript中生成带有随机数的数组
- angularjs - 角度 ng-if 中的 else 语句
- python - 修复奇怪引理的必要条件?