R Learning 1

Source: Internet
Author: User

First, install it.

There are 32 and 64 http://cran.rstudio.com/bin/windows/base/R-3.2.1-win.exe inside.

R has a lot of packages, if some packages are not local, come here to search

http://cran.r-project.org/

Automatic installation command:

Install.packages (' The name of the package ')

will be installed automatically, this package depends on the package will also be installed, the first time you install will let you choose mirror site, I certainly choose Xiamen, away from me recently.

If it fails, go to the website above to download it. Download the zip format, if you are using Rstudio,

Choose Tools, install Packages, local installation is OK.

Rstudio interface Introduction (Figure stole):

What package to use to load first, just like the import of Python. Command:

Library (package name)

Tab completion function

If you don't understand, ask:

? Base or help (base)

? function Display Help information example (function) Display example

Use # Single Comment

Each time you close, you are prompted to save your workspace. Save it will record your history command, define the object and so on, next time you can do it.

Win7 default is saved in ' c:/users/freemao/documents ' default file name is. RData and. Rhistory

Specify the Save workspace: Save.image (' file_name. RData ')

Reads a workspace to the current session load (' file_name. RData ') defaults to. RData

Delete the saved space: File.remove (' file_name. RData ')

View current working directory: GETWD ()

Modify the current working directory: SETWD (' dir ')

History () View historical commands

LS () Lists all objects in the current workspace

RM () Delete one or more objects

Save the specified object to a file: Save (ObjectList, file= ' my file ')

The next time you want to use the direct load (' My file ') These objects can be used, of course, can also be deleted, with File.remove (' My file ')

Summarize:

How to install R packages

Workspace save, load, delete

Common commands

Library (),

Install.packages ()

Example (),

Help (),

?,

History ()

LS (),

RM (),

GETWD (),

SETWD (),

Save (),

Save.image (),

Load (),

File.remove (),

R Learning 1

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.