99999久久久久久亚洲,欧美人与禽猛交狂配,高清日韩av在线影院,一个人在线高清免费观看,啦啦啦在线视频免费观看www

熱線電話:13121318867

登錄
首頁(yè)精彩閱讀用R語(yǔ)言進(jìn)行數(shù)據(jù)分析:常用函數(shù)參考
用R語(yǔ)言進(jìn)行數(shù)據(jù)分析:常用函數(shù)參考
2016-02-24
收藏

R語(yǔ)言進(jìn)行數(shù)據(jù)分析:常用函數(shù)參考

對(duì)于很多數(shù)據(jù)分析師來(lái)說(shuō),R語(yǔ)言都不陌生,應(yīng)為在做數(shù)據(jù)分析時(shí),常會(huì)用到它,下面是我總結(jié)用R語(yǔ)言進(jìn)行數(shù)據(jù)分析:常用函數(shù)參考。希望對(duì)你們有所幫助。


基本 一、數(shù)據(jù)管理 vector:向量 numeric:數(shù)值型向量 logical:邏輯型向量 character;字符型向量 list:列表 
data.frame:數(shù)據(jù)框 c:連接為向量或列表 length:求長(zhǎng)度 subset:求子集 seq,from:to,sequence:等差序列
rep:重復(fù) NA:缺失值 NULL:空對(duì)象 sort,order,unique,rev:排序 unlist:展平列表 attr,attributes:對(duì)象屬性 
mode,typeof:對(duì)象存儲(chǔ)模式與類型 names:對(duì)象的名字屬性 二、字符串處理 character:字符型向量 nchar:字符數(shù) substr:取子串 format,formatC:把對(duì)象用格式轉(zhuǎn)換為字符串 paste,strsplit:連接或拆分
charmatch,pmatch:字符串匹配 grep,sub,gsub:模式匹配與替換 三、復(fù)數(shù) complex,Re,Im,Mod,Arg,Conj:復(fù)數(shù)函數(shù) 四、因子 factor:因子 codes:因子的編碼 levels:因子的各水平的名字 nlevels:因子的水平個(gè)數(shù) cut:把數(shù)值型對(duì)象分區(qū)間轉(zhuǎn)換為因子 
table:交叉頻數(shù)表 split:按因子分組 aggregate:計(jì)算各數(shù)據(jù)子集的概括統(tǒng)計(jì)量 tapply:對(duì)“不規(guī)則”數(shù)組應(yīng)用函數(shù) 數(shù)學(xué) 一、計(jì)算 +, -, *, /, ^, %%, %/%:四則運(yùn)算 ceiling,floor,round,signif,trunc,zapsmall:舍入 max,min,pmax,pmin:最大最小值 
range:最大值和最小值 sum,prod:向量元素和,積 cumsum,cumprod,cummax,cummin:累加、累乘 sort:排序 approx和approx fun:插值 diff:差分 sign:符號(hào)函數(shù) 二、數(shù)學(xué)函數(shù) abs,sqrt:絕對(duì)值,平方根 log, exp, log10, log2:對(duì)數(shù)與指數(shù)函數(shù) sin,cos,tan,asin,acos,atan,atan2:三角函數(shù) 
sinh,cosh,tanh,asinh,acosh,atanh:雙曲函數(shù) beta,lbeta,gamma,lgamma,digamma,trigamma,tetragamma,pentagamma,choose ,lchoose:與貝塔函數(shù)、伽瑪函數(shù)、組合數(shù)有關(guān)的特殊函數(shù) fft,mvfft,convolve:富利葉變換及卷積 polyroot:多項(xiàng)式求根 poly:正交多項(xiàng)式 spline,splinefun:樣條差值 
besselI,besselK,besselJ,besselY,gammaCody:Bessel函數(shù) deriv:簡(jiǎn)單表達(dá)式的符號(hào)微分或算法微分 三、數(shù)組 array:建立數(shù)組 matrix:生成矩陣 data.matrix:把數(shù)據(jù)框轉(zhuǎn)換為數(shù)值型矩陣 lower.tri:矩陣的下三角部分 mat.or.vec:生成矩陣或向量 t:矩陣轉(zhuǎn)置
cbind:把列合并為矩陣 rbind:把行合并為矩陣 diag:矩陣對(duì)角元素向量或生成對(duì)角矩陣 aperm:數(shù)組轉(zhuǎn)置 nrow, ncol:計(jì)算數(shù)組的行數(shù)和列數(shù) dim:對(duì)象的維向量 
dimnames:對(duì)象的維名 row/colnames:行名或列名 %*%:矩陣乘法 crossprod:矩陣交叉乘積(內(nèi)積) outer:數(shù)組外積 kronecker:數(shù)組的Kronecker積 
apply:對(duì)數(shù)組的某些維應(yīng)用函數(shù) tapply:對(duì)“不規(guī)則”數(shù)組應(yīng)用函數(shù) sweep:計(jì)算數(shù)組的概括統(tǒng)計(jì)量 aggregate:計(jì)算數(shù)據(jù)子集的概括統(tǒng)計(jì)量 scale:矩陣標(biāo)準(zhǔn)化
matplot:對(duì)矩陣各列繪圖 cor:相關(guān)陣或協(xié)差陣 Contrast:對(duì)照矩陣 row:矩陣的行下標(biāo)集 col:求列下標(biāo)集 四、線性代數(shù) solve:解線性方程組或求逆 eigen:矩陣的特征值分解 svd:矩陣的奇異值分解 backsolve:解上三角或下三角方程組 chol:Choleski分解 
qr:矩陣的QR分解 chol2inv:由Choleski分解求逆 五、邏輯運(yùn)算 <,>,<=,>=,==,!=:比較運(yùn)算符 !,&,&&,|,||,xor():邏輯運(yùn)算符 logical:生成邏輯向量 all,any:邏輯向量都為真或存在真
ifelse():二者擇一 match,%in%:查找 unique:找出互不相同的元素 which:找到真值下標(biāo)集合 duplicated:找到重復(fù)元素 六、優(yōu)化及求根 optimize,uniroot,polyroot:一維優(yōu)化與求根 程序設(shè)計(jì) 一、控制結(jié)構(gòu) if,else,ifelse,switch:分支 for,while,repeat,break,next:循環(huán) apply,lapply,sapply,tapply,sweep:替代循環(huán)的函數(shù)。

二、函數(shù) function:函數(shù)定義 source:調(diào)用文件 call:函數(shù)調(diào)用 .C,.Fortran:調(diào)用C或者Fortran子程序的動(dòng)態(tài)鏈接庫(kù)。 Recall:遞歸調(diào)用 
browser,debug,trace,traceback:程序調(diào)試 options:指定系統(tǒng)參數(shù) missing:判斷虛參是否有對(duì)應(yīng)實(shí)參 nargs:參數(shù)個(gè)數(shù) stop:終止函數(shù)執(zhí)行
on.exit:指定退出時(shí)執(zhí)行 eval,expression:表達(dá)式計(jì)算 system.time:表達(dá)式計(jì)算計(jì)時(shí) invisible:使變量不顯示 menu:選擇菜單(字符列表菜單) 其它與函數(shù)有關(guān)的還有:delay,delete.response,deparse,do.call,dput,environment ,,formals,format.info,interactive,
is.finite,is.function,is.language,is.recursive ,match.arg,match.call,match.fun,model.extract,name,parse,substitute,sys.parent ,warning,machine 三、輸入輸出 cat,print:顯示對(duì)象 sink:輸出轉(zhuǎn)向到指定文件 dump,save,dput,write:輸出對(duì)象 scan,read.table,load,dget:讀入 四、工作環(huán)境 ls,objects:顯示對(duì)象列表 rm, remove:刪除對(duì)象 q,quit:退出系統(tǒng) .First,.Last:初始運(yùn)行函數(shù)與退出運(yùn)行函數(shù)。 
options:系統(tǒng)選項(xiàng) ?,help,help.start,apropos:幫助功能 data:列出數(shù)據(jù)集 統(tǒng)計(jì)計(jì)算 一、統(tǒng)計(jì)分布 每一種分布有四個(gè)函數(shù):d――density(密度函數(shù)),p――分布函數(shù),q――分位數(shù)函數(shù),r――隨機(jī)數(shù)函數(shù)。
比如,正態(tài)分布的這四個(gè)函數(shù)為dnorm,pnorm,qnorm,rnorm。下面我們列出各分布后綴,前面加前綴d、p、q或r就構(gòu)成函數(shù)名: norm:正態(tài),t:t分布,f:F分布,chisq:卡方(包括非中心) unif:均勻,exp:指數(shù),weibull:威布爾,gamma:伽瑪,beta:貝塔 
lnorm:對(duì)數(shù)正態(tài),logis:邏輯分布,cauchy:柯西, binom:二項(xiàng)分布,geom:幾何分布,hyper:超幾何,nbinom:負(fù)二項(xiàng),pois:泊松 signrank:符號(hào)秩,
wilcox:秩和,tukey:學(xué)生化極差 二、簡(jiǎn)單統(tǒng)計(jì)量 sum, mean, var, sd, min, max, range, median, IQR(四分位間距)等為統(tǒng)計(jì)量,sort,order,rank與排序有關(guān),其它還有ave,fivenum,mad,quantile,stem等。 三、統(tǒng)計(jì)檢驗(yàn) R中已實(shí)現(xiàn)的有chisq.test,prop.test,t.test。 四、多元分析 cor,cov.wt,var:協(xié)方差陣及相關(guān)陣計(jì)算 biplot,biplot.princomp:多元數(shù)據(jù)biplot圖 cancor:典則相關(guān) princomp:主成分分析 hclust:譜系聚類 
kmeans:k-均值聚類 cmdscale:經(jīng)典多維標(biāo)度 其它有dist,mahalanobis,cov.rob。 五、時(shí)間序列 ts:時(shí)間序列對(duì)象 diff:計(jì)算差分 time:時(shí)間序列的采樣時(shí)間 window:時(shí)間窗 六、統(tǒng)計(jì)模型 lm,glm,aov:線性模型、廣義線性模型、方差分析

數(shù)據(jù)分析咨詢請(qǐng)掃描二維碼

若不方便掃碼,搜微信號(hào):CDAshujufenxi

數(shù)據(jù)分析師資訊
更多

OK
客服在線
立即咨詢
客服在線
立即咨詢
') } function initGt() { var handler = function (captchaObj) { captchaObj.appendTo('#captcha'); captchaObj.onReady(function () { $("#wait").hide(); }).onSuccess(function(){ $('.getcheckcode').removeClass('dis'); $('.getcheckcode').trigger('click'); }); window.captchaObj = captchaObj; }; $('#captcha').show(); $.ajax({ url: "/login/gtstart?t=" + (new Date()).getTime(), // 加隨機(jī)數(shù)防止緩存 type: "get", dataType: "json", success: function (data) { $('#text').hide(); $('#wait').show(); // 調(diào)用 initGeetest 進(jìn)行初始化 // 參數(shù)1:配置參數(shù) // 參數(shù)2:回調(diào),回調(diào)的第一個(gè)參數(shù)驗(yàn)證碼對(duì)象,之后可以使用它調(diào)用相應(yīng)的接口 initGeetest({ // 以下 4 個(gè)配置參數(shù)為必須,不能缺少 gt: data.gt, challenge: data.challenge, offline: !data.success, // 表示用戶后臺(tái)檢測(cè)極驗(yàn)服務(wù)器是否宕機(jī) new_captcha: data.new_captcha, // 用于宕機(jī)時(shí)表示是新驗(yàn)證碼的宕機(jī) product: "float", // 產(chǎn)品形式,包括:float,popup width: "280px", https: true // 更多配置參數(shù)說(shuō)明請(qǐng)參見:http://docs.geetest.com/install/client/web-front/ }, handler); } }); } function codeCutdown() { if(_wait == 0){ //倒計(jì)時(shí)完成 $(".getcheckcode").removeClass('dis').html("重新獲取"); }else{ $(".getcheckcode").addClass('dis').html("重新獲取("+_wait+"s)"); _wait--; setTimeout(function () { codeCutdown(); },1000); } } function inputValidate(ele,telInput) { var oInput = ele; var inputVal = oInput.val(); var oType = ele.attr('data-type'); var oEtag = $('#etag').val(); var oErr = oInput.closest('.form_box').next('.err_txt'); var empTxt = '請(qǐng)輸入'+oInput.attr('placeholder')+'!'; var errTxt = '請(qǐng)輸入正確的'+oInput.attr('placeholder')+'!'; var pattern; if(inputVal==""){ if(!telInput){ errFun(oErr,empTxt); } return false; }else { switch (oType){ case 'login_mobile': pattern = /^1[3456789]\d{9}$/; if(inputVal.length==11) { $.ajax({ url: '/login/checkmobile', type: "post", dataType: "json", data: { mobile: inputVal, etag: oEtag, page_ur: window.location.href, page_referer: document.referrer }, success: function (data) { } }); } break; case 'login_yzm': pattern = /^\d{6}$/; break; } if(oType=='login_mobile'){ } if(!!validateFun(pattern,inputVal)){ errFun(oErr,'') if(telInput){ $('.getcheckcode').removeClass('dis'); } }else { if(!telInput) { errFun(oErr, errTxt); }else { $('.getcheckcode').addClass('dis'); } return false; } } return true; } function errFun(obj,msg) { obj.html(msg); if(msg==''){ $('.login_submit').removeClass('dis'); }else { $('.login_submit').addClass('dis'); } } function validateFun(pat,val) { return pat.test(val); }