zoukankan      html  css  js  c++  java
  • R语言学习5数学函数

    基本数学函数:

    abs, sqrt, ceiling, floor, trunc, round, signif, sin, asin, sinh, log(x, base=n), log, log10, exp

    abs(-2)
    exp(c(-1,0,1,2))
    

     统计函数

    mean 平均值
    median 中位数
    sd 标准差
    var 方差
    mad 绝对中位数
    quantile(x, probs) 分位数
    range 值域
    sum 求和
    diff(x, lag=n) 滞后差分
    min 最小值
    max 最大值
    scale(x, center=TRUE, scale=TRUE) 按列进行中心化

    概率函数:

    概率函数前面的字母前缀dpqr:

    d密度函数

    p分布函数

    q分位数函数

    r生成随机数

    分布名称:

    beta Beta分布

    binom 二项分布

    cauchy 柯西分布

    chisq 卡方分布

    exp 指数分布

    f F分布

    gamma Gamma分布

    gem 几何分布

    hyper 超几何分布

    lnorm 对数正态分布

    logis Logistic分布

    multinom 多项分布

    nbinom 负二项分布

    norm 正态分布

    pois 泊松分布

    t t分布

    unif 均匀分布

    例如生成5个正态分布的随机数

    rnorm(5)

  • 相关阅读:
    STL之vector
    STL之string
    STL之map
    STL之queue
    STL之set
    Ubuntu 12.04 输入法托盘图标消失
    Hibernate:No row with the given identifier exists
    Java 数组
    Oracle 简单备份 批处理(BAT)
    Oracle DataBase Link
  • 原文地址:https://www.cnblogs.com/saieuler/p/5416827.html
Copyright © 2011-2022 走看看