1. 程式人生 > >R語言第二天

R語言第二天

檢視和更改R語言工作空間

getwd() 顯示當前工作空間

setwd()更改當前工作空間

 列出當前工作空間的物件

ls()

rm() 移除(刪除)一個或多個物件

> ls()
 [1] "b"       "c"       "course"  "d"       "dat1"    "depart"  "dim1"   
 [8] "dim2"    "dim3"    "en"      "grade"   "i"       "id"      "math"   
[15] "mylist"  "name"    "
sc" "Score" "setdata" "student" "sum" [22] "x" "y" > rm(b,c,d) > ls() [1] "course" "dat1" "depart" "dim1" "dim2" "dim3" "en" [8] "grade" "i" "id" "math" "mylist" "name" "sc" [15] "Score" "setdata" "student" "sum" "x" "
y"

 q()退出R

q()

 library()能顯示有多少個程式包

R程式包是多個函式的集合

> library()

圖書館‘D:/R-3.5.1/library’裡有個程輯包:

base                   The R Base Package
boot                   Bootstrap Functions (Originally by Angelo
                       Canty for S)
class                  Functions for
Classification cluster "Finding Groups in Data": Cluster Analysis Extended Rousseeuw et al. codetools Code Analysis Tools for R compiler The R Compiler Package datasets The R Datasets Package foreign Read Data Stored by 'Minitab', 'S', 'SAS', 'SPSS', 'Stata', 'Systat', 'Weka', 'dBase', ... graphics The R Graphics Package grDevices The R Graphics Devices and Support for Colours and Fonts grid The Grid Graphics Package KernSmooth Functions for Kernel Smoothing Supporting Wand & Jones (1995) lattice Trellis Graphics for R MASS Support Functions and Datasets for Venables and Ripley's MASS Matrix Sparse and Dense Matrix Classes and Methods methods Formal Methods and Classes mgcv Mixed GAM Computation Vehicle with Automatic Smoothness Estimation nlme Linear and Nonlinear Mixed Effects Models nnet Feed-Forward Neural Networks and Multinomial Log-Linear Models parallel Support for Parallel computation in R rpart Recursive Partitioning and Regression Trees spatial Functions for Kriging and Point Pattern Analysis splines Regression Spline Functions and Classes stats The R Stats Package stats4 Statistical Functions using S4 Classes survival Survival Analysis tcltk Tcl/Tk Interface tools Tools for Package Development translations The R Translations Package utils The R Utils Package