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

猜你喜欢

转载自www.cnblogs.com/axianz/p/10015426.html