Advanced R之词汇表
转载请注明出处:http://www.cnblogs.com/lizichao/p/4800513.html
词汇表
想要玩得转R,重要的一点是有一个好的工作词汇表。以下是我认为的一个好的词汇表。你不必熟悉每个函数的细节,但是你应该知道它们的存在。如果词汇表中的函数你没有听说过,我强烈建议你阅读下相关文档。
我阅读了base包、stats包、untils包所有的函数,并提取了我认为最重要的函数,组成了下列的词汇表。列表中也有一些其他包中的重要函数,而且还有一些更加重要的,比如options()。
基本函数
# The first functions to learn
?
str # Important operators and assignment
%in%, match
=, <-, <<-
$, [, [[, head, tail, subset
with
assign, get # Comparison
all.equal, identical
!=, ==, >, >=, <, <=
is.na, complete.cases
is.finite # Basic math
*, +, -, /, ^, %%, %/%
abs, sign
acos, asin, atan, atan2
sin, cos, tan
ceiling, floor, round, trunc, signif
exp, log, log10, log2, sqrt max, min, prod, sum
cummax, cummin, cumprod, cumsum, diff
pmax, pmin
range
mean, median, cor, sd, var
rle # Functions to do with functions
function
missing
on.exit
return, invisible # Logical & sets
&, |, !, xor
all, any
intersect, union, setdiff, setequal
which # Vectors and matrices
c, matrix
# automatic coercion rules character > numeric > logical
length, dim, ncol, nrow
cbind, rbind
names, colnames, rownames
t
diag
sweep
as.matrix, data.matrix # Making vectors
c
rep, rep_len
seq, seq_len, seq_along
rev
sample
choose, factorial, combn
(is/as).(character/numeric/logical/...) # Lists & data.frames
list, unlist
data.frame, as.data.frame
split
expand.grid # Control flow
if, &&, || (short circuiting)
for, while
next, break
switch
ifelse # Apply & friends
lapply, sapply, vapply
apply
tapply
replicate
常见数据结构相关函数
# Date time
ISOdate, ISOdatetime, strftime, strptime, date
difftime
julian, months, quarters, weekdays
library(lubridate) # Character manipulation
grep, agrep
gsub
strsplit
chartr
nchar
tolower, toupper
substr
paste
library(stringr) # Factors
factor, levels, nlevels
reorder, relevel
cut, findInterval
interaction
options(stringsAsFactors = FALSE) # Array manipulation
array
dim
dimnames
aperm
library(abind)
统计函数
# Ordering and tabulating
duplicated, unique
merge
order, rank, quantile
sort
table, ftable # Linear models
fitted, predict, resid, rstandard
lm, glm
hat, influence.measures
logLik, df, deviance
formula, ~, I
anova, coef, confint, vcov
contrasts # Miscellaneous tests
apropos("\\.test$") # Random variables
(q, p, d, r) * (beta, binom, cauchy, chisq, exp, f, gamma, geom,
hyper, lnorm, logis, multinom, nbinom, norm, pois, signrank, t,
unif, weibull, wilcox, birthday, tukey) # Matrix algebra
crossprod, tcrossprod
eigen, qr, svd
%*%, %o%, outer
rcond
solve
使用R
# Workspace
ls, exists, rm
getwd, setwd
q
source
install.packages, library, require # Help
help, ?
help.search
apropos
RSiteSearch
citation
demo
example
vignette # Debugging
traceback
browser
recover
options(error = )
stop, warning, message
tryCatch, try
输入/输出
# Output
print, cat
message, warning
dput
format
sink, capture.output # Reading and writing data
data
count.fields
read.csv, write.csv
read.delim, write.delim
read.fwf
readLines, writeLines
readRDS, saveRDS
load, save
library(foreign) # Files and directories
dir
basename, dirname, tools::file_ext
file.path
path.expand, normalizePath
file.choose
file.copy, file.create, file.remove, file.rename, dir.create
file.exists, file.info
tempdir, tempfile
download.file, library(downloader)
Advanced R之词汇表的更多相关文章
- Advanced R之函数
转载请注明出处,谢谢. 再次声明下,本人水平有些,错误之处敬请指正. 函数 函数是R基本的块结构单元:为了掌握本书中的更高级技术,你需要对函数有扎实的了解.也许你已经写过一些函数,并了解函数的基本知识 ...
- C++ 词汇表
C++词汇表 A abort() 特殊函数 如果一个函数抛出异常,但在通往异常函数的调用链中找不到与之匹配的catch,则该程序通常以此函数调用终止 abs ...
- Transformers 词汇表 | 二
作者|huggingface 编译|VK 来源|Github 词汇表每种模型都不同,但与其他模型相似.因此,大多数模型使用相同的输入,此处将在用法示例中进行详细说明. 输入ID 输入id通常是传递给模 ...
- Paip.语义分析----情绪情感词汇表总结
Paip.语义分析----情绪情感词汇表总结 以下词语是按感情色彩共分为十四类: 作者Attilax 艾龙, EMAIL:1466519819@qq.com 来源:attilax的专栏 地址:h ...
- CSS Vocabulary – CSS 词汇表,你都掌握了吗?
CSS 是前端开发必备技能,入门容易,深入难.比如像 Pseudo-class.Pseudo-element.Media query.Media type 以及 Vendor prefix 的概念,很 ...
- .Net词汇表中常见缩略语汇总
.Net中存在大量的专业词汇(详细列表,请参考:Visual Studio 和 .NET Framework 词汇表),其中很多词汇常常采用缩略语的形式被大量使用. 在阅读.Net书籍或网络资料时,便 ...
- USD词汇表(USD Glossary)
这篇文章是在学习USD的过程中龟速写成的,目的是将USD的核心设计.相关概念的说明.以及配套API整理出来,为后续进行的USD开发工作提供中文资料支持. 实际上也只有充分理解了USD设计中的每一个知识 ...
- 腾讯互动课堂(Tencent Interact Class,TIC)SDK 词汇表
词汇表 https://cloud.tencent.com/document/product/266/11732 封装格式 封装格式(Format)是将已经编码压缩好的视频流和音频流按照一定的格式规范 ...
- IT词汇表
本人采集到了数十万篇中文技术类博客,进行分词后根据出现的词频手工整理了一份IT词汇表,共计12000个,基本囊括了常见的中英文IT词汇,欢迎各位提出交流意见. 点此 下载
随机推荐
- 巧用redis位图存储亿级数据与访问
业务背景 现有一个业务需求,需要从一批很大的用户活跃数据(2亿+)中判断用户是否是活跃用户.由于此数据是基于用户的各种行为日志清洗才能得到,数据部门不能提供实时接口,只能提供包含用户及是否活跃的指定格 ...
- scikit-learn:4. 数据集预处理(clean数据、reduce降维、expand增维、generate特征提取)
本文參考:http://scikit-learn.org/stable/data_transforms.html 本篇主要讲数据预处理,包含四部分: 数据清洗.数据降维(PCA类).数据增维(Kern ...
- C#定时检測子线程是否已经完毕
C#定时检測子线程是否已经完毕 class Program { static void Main(string[] args) { //主线程中启动一个支线程,运行doSomething这种一个方法. ...
- GS给客户单发包以及m_queGcWait(所有GC共享)
GS给客户单发包以及m_queGcWait(所有GC共享) send_stat BaseChannel::SendCmd(int nCmd, void* pData, int nLen) { Prot ...
- 我的Android进阶之旅------>直接拿来用!最火的Android开源项目
转载于CSDN,相关链接如下: http://www.csdn.net/article/2013-05-03/2815127-Android-open-source-projects http://w ...
- python mmap使用记录
1.写文件 with open('??', 'r+b') as f: with contextlib.closing(mmap.mmap(f.fileno(), size, flags=mmap.MA ...
- mysql服务器启动问题
The server quit without updating PID file (/usr/local/mysql/data/snsgou.pid);可能的情况是启动的用户不对,
- java集合讲解干货集
文章都来自网络,收集后便于查阅. 1.Java 集合系列01之 总体框架 2.Java 集合系列02之 Collection架构 3.Java 集合系列03之 ArrayList详细介绍(源码解析)和 ...
- Machine Learning No.10: Anomaly detection
1. Algorithm 2. evaluating an anomaly detection system 3. anomaly detection vs supervised learning 4 ...
- ES6 Fetch API HTTP请求实用指南
本次将介绍如何使用Fetch API(ES6 +)对REST API的 HTTP请求,还有一些示例提供给大家便于大家理解. 注意:所有示例均在带有箭头功能的 ES6中给出. 当前的Web /移动应用程 ...