我如何问一个很好的ggplot/点阵/基本图问题? [英] How can I ask a great ggplot / lattice / base plot question?

查看:119
本文介绍了我如何问一个很好的ggplot/点阵/基本图问题?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已阅读如何制作出色的R可再现示例著名的话题,但是没有关于如何提出一个很好的ggplotlattice或底图的很好的R问题的具体建议.

I have read the How to make a great R reproducible example famous thread, but there is no specific advice regarding how to ask a great ggplot, lattice or base-plots great R question.

创建出色示例的技巧是什么?

What are your tips to create an excellent example?

您应该包括或避免使用哪些信息?

What information should you include or avoid?

您如何陈述预期的输出?

How do you state your expected output?

建议的附图大小和格式是什么?

What are the recommended sizes and formatting of attached plots?

推荐答案

首先,按照公认的标准提出一个很好的R问题,并提出一个很好的R可重现示例(请参阅

First, follow the agreed-upon standards to ask a great R question and make a great R reproducible example (see this discussion):

  1. 共享您的数据.小而简单的数据足以重现该问题.
  2. 不要重载保留的名称,例如cdfdata.
  3. 尽可能使用R或程序包的标准数据集,例如mtcarsiris.不共享文件链接,我们大多数人不喜欢从未知方下载文件.
  4. 分享您的代码.
  1. Share your data. Data small and simple enough to reproduce the problem.
  2. Don't overload reserved names, such as c, df or data.
  3. As far as possible, use R's or package's standard datasets, such as mtcars or iris. Don't share links to files, most of us don't like downloading files from unknown parties.
  4. Share your code.

有关图形/图解/地图生成代码,请:

For graph/plot/map-generating code, please:

  1. 包括对libraryrequire的调用,这些调用用于加载生成绘图/图形/地图所用的程序包.
  2. 去除代码中的所有修饰部分,除非您要解决的问题与此类修饰专门有关.过多和不必要的代码使问题变得混乱,使其更难以理解和解决.

  1. Include calls to library or require used to load packages with which you produced the plots/graphs/maps.
  2. Strip out all the cosmetic parts of the code, unless the problem you want to address has to do specifically with such cosmetics. Excessive and unnecessary code clutters the question, making it more difficult to understand and address.

  1. theme调用以格式化背景,颜色,轴等.
  2. labs调用以及用于设置标题,字幕等的任何类似方法.
  3. 线,轴,填充线和类似零件的颜色.
  1. theme calls to format backgrounds, colors, axes and the like.
  2. labs calls and any similarly used to set titles, subtitles and the like.
  3. Coloring of lines, axis, fills and similar components.

  • 检查数据是否整齐.如果您必须重复调用以生成绘图中的每一行,则可能数据不整齐.

  • Check if your data is tidy. If you have to make repetitive calls to produce each line in your plot, it's likely your data isn't tidy.

    关于您的预期输出,请尽可能用言语表述.如果需要一张图片,请提供至少一个具有以下特征的图片:

    Regarding your expected output, state it in words whenever possible. If an image is needed, please include one with at least these characteristics:

    • 大小:它应该足够大,以使潜在的帮助者可以欣赏到您期望的输出的细节,但又要足够小,即使在不稳定的Internet连接下也可以快速加载.
    • 类型:使用可在大多数浏览器中呈现的格式:jpg和png是不错的选择.避免使用不需要或需要专有软件才能显示的格式.
    • 它不需要代码生成.如果画质足够好并且专注于绘图的预期细节,那么绘画版本甚至手绘版本就足够了.
    • 避免共享下载图像的链接,特别是在标准浏览器中无法显示格式的情况下:我们大多数人不喜欢从未知方下载文件.

    这篇关于我如何问一个很好的ggplot/点阵/基本图问题?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

  • 查看全文
    登录 关闭
    扫码关注1秒登录
    发送“验证码”获取 | 15天全站免登陆