Intellipaat Back

Explore Courses Blog Tutorials Interview Questions
0 votes
4 views
in R Programming by (50.2k points)
I want to create an array of numbers starting from 40.56 to 100.00. But it can only be incremented 25 times. Meaning there needs to perfectly be 25 increments between 40.56 and 100.00.

How can I perform this in R?

1 Answer

0 votes
by (107k points)

In R programming, you can take the help of seq() for getting the desired output. In seq() you can have the length.out argument specifying the desired length of the sequence.

seq(40.56, 100, length.out = 25)

#[1]  40.6  43.0  45.5  48.0  50.5  52.9  55.4  57.9  60.4

#[10]  62.9  65.3  67.8  70.3  72.8  75.2  77.7  80.2  82.7

#[19]  85.1  87.6  90.1  92.6  95.0  97.5 100.0

31k questions

32.8k answers

501 comments

693 users

Browse Categories

...