Suppose you have a list of variables. You don’t want to type the name of each variable every time to define them within the function or array. You are looking for a shortcut to accomplish this task.
Create a dataset with a list of variables
How to specify a list of variables
A single dash (-) refers to specify consecutive numbered variables. For example: a1-a4;
A double dash (–) refers to specify variables based on the order of the variables as they appear/entered in the file, regardless of the name of the variables.
In the above program, a1-a4 includes a1, a2, a3 and a4, whereas a1--a4 includes a1, a3 and a4 only as they appear the same way in file.
How to specify all NUMERIC variables
How to use double dash in array
The below-defined program will subtract one from values in variables a1, a3 and a4.
How to use numeric variables in array
The below-defined program will subtract one from values in numeric variables.
- C# | Variables
- JS++ | Variables and Data Types
- How to drop variables from a dataset in SAS Programming?
- How to avoid Compile Error while defining Variables
- Doubly Linked List Tutorial
- A Categorical List of programming languages
- Converting a List to Vector in R Language - unlist() Function
- How to Learn Python in 21 Days?
- Top Programming Languages for Data Science in 2020
- Top 5 Most Loved Programming Languages in 2020
- What happens when we call a Function
- Matrix operations using operator overloading
- How to take input in Octave GNU?
- Switch case statement in Octave GNU
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.