我正在分析一些数据,并想在R上做一个Simpsons悖论。我已经安装了Simpsons包并加载了库。这是一个基于软件包文档的示例:
---
output: html_document
---
```{r}
library(Simpsons)
#generating data
Coffee1=rnorm(100,100,15)
Neuroticism1=(Coffee1*.8)+rnorm(100,15,8)
g1=cbind(Coffee1, Neuroticism1)
Coffee2=rnorm(100,170,15)
Neuroticism2=(300-(Coffee2*.8)+rnorm(100,15,8))
g2=cbind(Coffee2, Neuroticism2)
Coffee3=rnorm(100,140,15)
Neuroticism3=(200-(Coffee3*.8)+rnorm(100,15,8))
g3=cbind(Coffee3, Neuroticism3)
data2=data.frame(rbind(g1,g2,g3))
colnames(data2) <- c("Coffee","Neuroticism")
example <- Simpsons(Coffee,Neuroticism,data=data2)
plot(example)
```
Run Code Online (Sandbox Code Playgroud)
这将返回一个包含3个簇的图(正是我所需要的)。但是,当我将Rmd文件编织为HTML时,会得到很多等号(======),其旁边有一个百分比,例如一个加载网格,我想从最终输出中删除该网格。