From the course: R for Data Science: Lunch Break Lessons

Unlock this course with a free trial

Join today to access over 22,600 courses taught by industry experts.

Use range() and extendrange() to analyze and manipulate groups of numbers

Use range() and extendrange() to analyze and manipulate groups of numbers

From the course: R for Data Science: Lunch Break Lessons

Use range() and extendrange() to analyze and manipulate groups of numbers

- [Instructor] Range and extend range are useful for extending the breath of a numerical range which is essential for forecasting. So let's take a look at these two very useful commands. In order to demonstrate these I need a vector. So I'll create a vector. And we'll do something simple. We'll set one to 23 into a vector. So it's just a range of numbers. If I use the range command what I'll get is the minimum and maximum of the vector that we're working with. So the minimum is one and the maximum is 23. No different then if we just simply typed in min of a vector or max of a vector. So why do we even have range at all? Well, it works hand in hand with extend range. Let's look at extend range then. If I type in extend range a vector what we get is a new minimum and maximum value for a vector. Remember a vector starts at one and ends at 23. If I type in extend range, it goes to the left of the lowest number and the…

Contents