R language-data types and operators

Source: Internet
Author: User

I. Online installation package

Install.packages (Package_name)

Two. View variables

LS ()

Three. Deleting variables

RM ()

Four. Variable type

Meta data types: characters, shaping, numbers, imaginary, BOOL

Vector: Vec=c (a)

List: ls=list (1, ' A ', C ()

Matrix: Matri=matrix (C (1,2,2,2,3,4), nrow=2,ncol=3,byrow=ture)

Data frames: Frame=data.frame (name=c ("Zhangsan", "Wangwu", "Lisi"), Age=c (12,13,23), Gender=c ("M", "F", "M"))

Array: Arr=array (C (VEC1,VEC2), dim=c (number of rows, number of columns, dimensions)//each vector is arranged in columns

Factor: Vec=c (1,2,3,4)

Fac=factor (VEC)

Five, several important operators:

Percent: to find the remainder

%/%: Seeking integer quotient

%in%: Judging whether the former is in the latter

%*%: Multiplication of matrices with their inverse matrices

&& | | : Compare the first value of a vector

R language-data types and operators

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.