學習筆記183 R 語言的基礎

2022-06-06 16:09:10 字數 381 閱讀 6493

1、?+ 函式: 會彈出該函式的介紹用法(相當於matlab中 doc 命令);

2、?? + 包名:會幫你搜尋對應包的用法。

3、ctrl + l : 清屏。

4、rm(list = ls ()) : 清除變數歷史記錄。

5、ctrl + shift + c : 注釋命令列

6、class(mat) 或者 str(mat): 檢視mat的資料型別。

7、ehparse.matrix <- do.call(rbind, easyham.parse):將list格式轉換成矩陣

8、dim(): 檢視矩陣維度

9、intall.packages("nbclust") + library("nbclust"): 安裝乙個包並完成載入。

R語言學習筆記1 基礎

一般數字形式的資料都為數值型。class 函式檢視資料型別。x c 1,2,3,4 x 1 1 2 3 4 class x 1 numeric 僅含有整數,且資料型別設定為integer,否則為數值型。as.integer 可以將資料型別強制轉換為整數型。as.datatype 表示將其引數轉換為d...

R語言學習筆記

1.資料輸入 read.table n fileposition 函式 eg.x read.table c users administrator desktop 1.txt header t 目前只知道可以完好地讀入txt檔案 空格隔開 excel不支援 csv讀入不完全。ps.可以用excel生...

R語言學習筆記

二 data.frame資料框的常用操作 三 讀取資料檔案 四 排序函式 sort,rank,order 的區別 mydata tid s1 s2 1 1 2 1 2 1 2 1 3 1 3 2 4 2 4 3 5 3 5 4 unique mydata tid s1 s2 1 1 2 1 3 1 ...