Before installing the R software, you must first understand the type of system you are using, and choose the appropriate version according to the type of system you are using. It is better to use the Linux version for processing big data. Here, in order to learn quickly, install the graphical Windows version of the R software.
Step1: Log in to R official website, click CRAN, install R
Official website address : https://www.r-project.org
CRAN :Comprehensive R Archive Network, R's comprehensive network archive
Just choose a website close to the location
base is a binary version of R basic software,
The 32-bit and 64-bit of R software are the same installation package
Just go to the next step and install the next step. Double-click any one to use the R software.
Step2: Run and set
In a 64-bit Windows system, two R icons are generally generated on the desktop: Ri386 and R x64, which are 32-bit and 64-bit programs respectively. Generally, 32-bit programs will be faster, but 32-bit programs can only support 3G at most 64-bit system has no limitation on memory, so 64-bit software can make full use of memory to process big data
The picture below is the running interface of R software under Windows system. This interface is generally calledRgui (default graphical interface under R software)
ls() lists all options
R console, mainly typing code
Some common sense about R software
-
No matter what kind of system platform, R software has three operating modes: interactive, R script and R workspace
- After opening R, the default is interactive. The R software uses the> sign as a prompt, and the interactive command is entered, and the software returns the result
-
getwd(): Get working directory
-
If the line break R software will switch> to + sign, it means that you need to continue typing, knowing that the input is complete to fill the parentheses of the function
-
If there are many R commands that need to be entered each time, we can also save all the R codes to a file, generally with a .R extension, so that the code can be called repeatedly. This is the R script, or you can use the R script Set as input and output options and give some options to the script. This is an R script program. You can use the Rscript command to run the R script. Another is to save the running R as an R workspace image. If you press q to exit, select Y, save the workspace, and a .rdata file will be generated in the default working directory. Next time you can double-click to open this file to run R. The workspace is similar to creating a project in other software, and the data inside will be opened next time Are all there, you can proceed