Hi Swathi,
You can use ls() to list all variables that are created in the environment.
ls() can be used to fetch variables in different ways
Use ls() to display all variables.
![](https://www.edureka.co/community/?qa=blob&qa_blobid=1755521775948379022)
- Using a character pattern
pat = " " is used for pattern matching such as ^, $, ., etc.
![](https://www.edureka.co/community/?qa=blob&qa_blobid=1696829781922805343)
Hope it helps!
Transform data into actionable insights with our Data Analytics Course – Enroll today!