I want to list all objects in R that start with something, like starts with character “A”, I only know how to use ls(), is there a way to do so? Thanks!
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
ls()has apatternargument – see?ls. To search with an ‘a’ anywhere:Or with a regular expression to get things that start with “A”:
If you don’t know about regular expressions, but know about wildcards like ‘*’ and such, you can use
glob2rx():