R language Learning-sep and rep

Source: Internet
Author: User

Sep: Increase or decrease in number of steps from X to X

Seq (1, ten, By=1)

Seq (1, ten, by=0.1)

Seq (1.9, ten, by=0.1)

#注意, you can't decrement like this.
Seq (ten, 1, by=0.1)

#注意, you can decrement like this
Seq (ten, 1, by=-0.1)

#除了设置步长, you can also set the number of steps that are evenly divided
Seq (ten, 1, length.out=10)

Seq (ten, 1, length.out=100)

Seq (ten, 1, length.out=91)

#数清楚里面的个数
Length (SEQ (1, length.out=91))

Rep: repeat N times

Rep (3.14, 5)//3.14 repeat 5 times

Rep (123, 5)

Rep (1:10, 5)

Length (Rep (1:10, 5))

R language Learning-sep and rep

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.