R:让dplyr和摘要显示多于3位数字

如何解决R:让dplyr和摘要显示多于3位数字

这失败。我需要小数点右边的3位数字。

require("dplyr")
options(digits = 10)
group_by(MyData,Type_1,Type_2) %>%
  summarise(
  count = n(),mean = mean(Rate,na.rm = TRUE),sd = sd(Rate,na.rm = TRUE)
)

# A tibble: 4 x 5
# Groups:   Type_1 [2]
  Type_1  Type_2 count  mean    sd
  <fct>  <fct> <int> <dbl> <dbl>
1 A      X        8  1203. 120. 
2 A      Y        8  1324. 99.1
3 B      X        8  1162. 106. 
4 B      Y        8  1639. 118. 

我也尝试过

options(pillar.sigfigs=10)

我正在寻找一个答案。我用什么替换上面的数字设置?

感谢您的帮助。

解决方法

问题是我曾经说过要使用的参考

{% extends 'store/main.html' %}
{% load static %}
{% block content %}
    <div class="row justify-content-center">
    {% for product in products %}
        <div class="col-xs-12">
            <img class="thumbnail" src="{{ product.imageURL }}">
            <div class="box-element product">
                <div class="container">
                    <div class="row">
                        <div class="col">
                            <h4><strong>{{ product.name }}</strong></h4>
                        </div>
                        {% if product.print %}
                            <div class="col" id="size-info">
                                <h4 style="display: inline-block; float: right">
                                    <strong>size: {{ product.print.size }}</strong></h4>
                            </div>
                        {% endif %}
                    </div>
                </div>
                <hr>
                <div class="container">
                    <div class="row">
                        <div class="col-xs-2">
                            <div class="row">
                                {% if product.shirt %}
                                    <div class="col select-outline">
                                        <select id="size-selector" class="browser-default custom-select">
                                            <option value="" disabled>Size</option>
                                            {% for value,text in product.shirt.available_sizes %}
                                                <option value="{{ text }}">{{ text }}</option>
                                            {% endfor %}
                                        </select>
                                    </div>
                                {% endif %}
                            </div>
                        </div>
                        <div class="col-8">
                            <button data-product="{{ product.id }}" data-action="add" data-size="{{ text }}"
                                    class="btn btn-outline-secondary add-btn update-cart">Add to Cart
                            </button>
                            <a class="btn btn-outline-success" href="#">View</a>
                        </div>
                        <div class="col">
                            <h4 style="display: inline-block; float: right"><strong>${{ product.price }}</strong>
                            </h4>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    {% endfor %}
{% endblock content %}
</div>

何时需要使用

options(pillar.sigfigs=7)

R并没有给您一个错误,说明它不知道options(pillar.sigfig=7) 是什么意思。

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐


Selenium Web驱动程序和Java。元素在(x,y)点处不可单击。其他元素将获得点击?
Python-如何使用点“。” 访问字典成员?
Java 字符串是不可变的。到底是什么意思?
Java中的“ final”关键字如何工作?(我仍然可以修改对象。)
“loop:”在Java代码中。这是什么,为什么要编译?
java.lang.ClassNotFoundException:sun.jdbc.odbc.JdbcOdbcDriver发生异常。为什么?
这是用Java进行XML解析的最佳库。
Java的PriorityQueue的内置迭代器不会以任何特定顺序遍历数据结构。为什么?
如何在Java中聆听按键时移动图像。
Java“Program to an interface”。这是什么意思?
Java在半透明框架/面板/组件上重新绘画。
Java“ Class.forName()”和“ Class.forName()。newInstance()”之间有什么区别?
在此环境中不提供编译器。也许是在JRE而不是JDK上运行?
Java用相同的方法在一个类中实现两个接口。哪种接口方法被覆盖?
Java 什么是Runtime.getRuntime()。totalMemory()和freeMemory()?
java.library.path中的java.lang.UnsatisfiedLinkError否*****。dll
JavaFX“位置是必需的。” 即使在同一包装中
Java 导入两个具有相同名称的类。怎么处理?
Java 是否应该在HttpServletResponse.getOutputStream()/。getWriter()上调用.close()?
Java RegEx元字符(。)和普通点?