相关疑难解决方法(0)

如何制作一个很好的R可重复的例子

在与同事讨论性能,教学,发送错误报告或在邮件列表上搜索指导时,以及在Stack Overflow上,通常会询问可重复的示例并始终提供帮助.

您有什么建议创建优秀示例的提示?如何以文本格式粘贴中的数据结构?您还应该包含哪些其他信息?

在另外还有其他招数来使用dput(),dump()structure()?你什么时候应该包括library()require()声明?其中保留字应避免一个,此外c,df,data等?

怎样才能成为一位伟大的重复的例子?

r r-faq

2474
推荐指数
23
解决办法
28万
查看次数

Running multiple, simple linear regressions from dataframe in R

I have a dataset (data frame) with 5 columns all containing numeric values.

I'm looking to run a simple linear regression for each pair in the dataset.

For example, If the columns were named A, B, C, D, E, I want to run lm(A~B), lm(A~C), lm(A~D), ...., lm(D~E),... and, then I want to plot the data for each pair along with the regression line.

我对R很陌生,所以我在如何实现这一目标的过程中如何旋转.我应该用ddply吗?还是lapply?我真的不确定如何解决这个问题.

r linear-regression

6
推荐指数
1
解决办法
8697
查看次数

标签 统计

r ×2

linear-regression ×1

r-faq ×1