R语言seq()函数用法
1、seq()
用来生成一组数字的函数。
Usage:
## Default S3 method:
seq(from = 1, to = 1, by = ((to - from)/(length.out - 1)),
length.out = NULL, along.with = NULL, ...)
seq.int(from, to, by, length.out, along.with, ...)
seq_along(along.with)
seq_len(length.out)
Arguments:
... : arguments passed to or from methods.
from, to : the starting and (maximal) end values of the sequence. Of length 1 unless just
from : is supplied as an unnamed argument.
by : number: increment of the sequence.
length.out :desired length of the sequence. A non-negative number, which for seq and
seq.int : will be rounded up if fractional.
along.with : take the length from the length of this argument.
Typical usages are
seq(from, to)
seq(from, to, by= )
seq(from, to, length.out= )
seq(along.with= )
seq(from)
seq(length.out= )
Examples:
seq(0, 1, length.out = 11)
seq(stats::rnorm(20)) # effectively 'along'
seq(1, 9, by = 2) # matches 'end'
seq(1, 9, by = pi) # stays below 'end'
seq(1, 6, by = 3)
seq(1.575, 5.125, by = 0.05)
seq(17) # same as 1:17, or even better seq_len(17)
R语言seq()函数用法的更多相关文章
- R语言apply()函数用法
在R语言的帮助文档里,apply函数的功能是: Retruns a vector or array or list of values obtained by applying a function ...
- R语言 subset()函数用法
subset() 函数: subset(dataset , subset , select ) dataset 是 要进行操作的数据集 subset 是对数据的某些字段进行操作 select 选取要显 ...
- 【R】R语言常用函数
R语言常用函数 基本 一.数据管理vector:向量 numeric:数值型向量 logical:逻辑型向量character:字符型向量 list:列表 data.frame:数据框c:连接为向量或 ...
- linux c语言 select函数用法
linux c语言 select函数用法 表头文件 #i nclude<sys/time.h> #i nclude<sys/types.h> #i nclude<unis ...
- R语言table()函数
R语言table()函数比较有用,两个示例尤其是混淆矩阵这个案例比较有用: 例子一:统计频次 z<-c(1,2,2,4,2,7,1,1);z1<-table(z);summary(z1); ...
- R语言封装函数
R语言封装函数 原帖见豆瓣:https://www.douban.com/note/279077707/ 一个完整的R函数,需要包括函数名称,函数声明,函数参数以及函数体几部分. 1. 函数名称,即要 ...
- R语言—使用函数sample进行抽样
在医学统计学或者流行病学里的现场调查.样本选择经常会提到一个词:随机抽样.随机抽样是为了保证各比较组之间均衡性的一个很重要的方法.那么今天介绍的第一个函数就是用于抽样的函数sample: > ...
- R语言学习笔记——C#中如何使用R语言setwd()函数
在R语言编译器中,设置当前工作文件夹可以用setwd()函数. > setwd("e://桌面//")> setwd("e:\桌面\")> s ...
- R语言中函数调试
有时候会用R语言写一下简单的脚本处理函数,加入需要调试的话可以按照下面的步骤进行: fun <- function(x , y){ x + y x - y x * y x / y } debug ...
随机推荐
- Linux svn仓库备份到Windows机器上
Linux svn仓库备份到Windows机器上 1,需求说明,Linux作为主库(A),Windows作为本地备份库(B),要求每天将Linux库中的代码备份到本地 2,B机器上安装svn服务端 3 ...
- mysql查询条件字段值末尾有空格的问题
mark MYSQL的binary解决mysql数据大小写敏感问题的方法
- C0301 代码块{}的使用,重定向, 从文件中读取行
#!/bin/bash # 从 /etc/fstab 中读行 File=/etc/fstab { read line1 read line2 } < $File # {}代码块, ...
- Unity3D GUI图形用户界面系统
1.skin变量 using UnityEngine; using System.Collections; public class Skin : MonoBehaviour { public GUI ...
- .NET中二进制图片的存储与读取
判断HttpContext是否为空: string configPath = "img/defaultPhoto.png"; if (HttpContext.Current != ...
- ubuntu 自动清理/tmp目录
在Ubuntu系统中,在/tmp文件夹里面的内容,每次开机都会被清空,如果不想让他自动清理的话,只需要更改rcS文件中的TMPTIME的值. 我们看如何来修改 sudo vi /etc/default ...
- windows 下安装securecrt 绿色版
- [MachineLearning]KNN
# -*- coding: utf-8 -*- """ Created on Wed Jun 18 11:46:15 2014 @author: hp "&qu ...
- boost诊断工具BOOST_ASSERT、BOOST_VERIFY、BOOST_STATIC_ASSERT
boost.assert提供的主要工具是BOOST_ASSERT宏,类似于C语言的assert,提供运行时的断言,但功能有所增强; 默认情况下,BOOST_ASSERT宏等同于assert宏: # d ...
- oralce函数
1.trunc函数处理数字和日期TRUNC(NUMBER[,DECIMAL]) 数字格式TRUNC(DATE[,FOMAT]) 日期格式2.round函数(四舍五入)ROUND(NUMBER[,DEC ...