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

熱線電話:13121318867

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

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

對于很多數(shù)據(jù)分析師來說,R語言都不陌生,應為在做數(shù)據(jù)分析時,常會用到它,下面是我總結用R語言進行數(shù)據(jù)分析:常用函數(shù)參考。希望對你們有所幫助。


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

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

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

若不方便掃碼,搜微信號:CDAshujufenxi

數(shù)據(jù)分析師考試動態(tài)
數(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(), // 加隨機數(shù)防止緩存 type: "get", dataType: "json", success: function (data) { $('#text').hide(); $('#wait').show(); // 調用 initGeetest 進行初始化 // 參數(shù)1:配置參數(shù) // 參數(shù)2:回調,回調的第一個參數(shù)驗證碼對象,之后可以使用它調用相應的接口 initGeetest({ // 以下 4 個配置參數(shù)為必須,不能缺少 gt: data.gt, challenge: data.challenge, offline: !data.success, // 表示用戶后臺檢測極驗服務器是否宕機 new_captcha: data.new_captcha, // 用于宕機時表示是新驗證碼的宕機 product: "float", // 產品形式,包括:float,popup width: "280px", https: true // 更多配置參數(shù)說明請參見:http://docs.geetest.com/install/client/web-front/ }, handler); } }); } function codeCutdown() { if(_wait == 0){ //倒計時完成 $(".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 = '請輸入'+oInput.attr('placeholder')+'!'; var errTxt = '請輸入正確的'+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); }