Attention
- R Case insensitive
- The object of R can be anything (data, functions, graphs, analysis results , etc.)
- Assignment: <-(Common), = (less useful); #注释
- You can use the UP and DOWN ARROW keys to view the history of entered commands
Working space
- Working space (workspace) Working environment for current R
- Current working directory (working directory): Working directory to read files and save results
#创建新目录dir. Create ('D:/documents/text') #设置当前的工作目录setwd ('D:/documents/text'# shows a format with three digits after the decimal point as a valid number, mainly used to set the calculation and display results that can change the R global Options option () Options (digits=3) #包含20个均匀随机变量的向量x<-runif ( -#生成数据的摘要统计量和直方图summary (x) #询问是否保存工作空间, the history of the y command is saved to the file. Rhistory, the workspace (including vector x) is saved to the file in the directory. RData, end of Session, exit program Q () #再次打开工作空间, restart SETWD from where the last session ended ('D:/documents/text') Load ('. RData')
The use of R in the "R language Combat"