Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

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.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7825635
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T09:05:29+00:00 2026-06-02T09:05:29+00:00

By accident I created a variable called ls which I have spotted using ls().

  • 0

By accident I created a variable called ls which I have spotted using ls(). So there exist a function ls() and a variable with the identical name. I do not know what kind of variable it is and don’t know the content because all attempts failed to access the variable.

ls 

returned the body of the ls() function.

get("ls")

returned Error in get(ls) : invalid first argument

get("ls", mode="numeric")

object ‘ls’ of mode ‘numeric’ was not found

get("ls", mode=!"function")

is not a valid argument.
So how can I access the variable? I tried also class(ls) and str(ls) but all is referring to ls as a function.

I can’t find the right question to this. But I am sure I have read about that before. So I am sorry if that is a duplicate post. Help and a link would be appreciated.

EDIT: the output of dput(ls()[grep("^ls$", ls())]) is:

"ls"

EDIT: the output of dput(ls()) is:

c("bplo.anno", "c", "combinations.formula", "combo.form", "df", "df.group.unique", "df.test", "dir.work", "form.compl", "fun.boot.lm.stepAIC.4", "fun.boot.lm.stepAIC.5", "fun.CoerceListOfVectorToMatrix", "fun.data.preparation", "fun.dcor.DataFrame", "fun.expand.complete.interaction", "fun.g.ellipse.orig", "fun.K_fold", "fun.lappend", "fun.lm.subset", "fun.lm_AIC", "fun.lst.powerset", "fun.MaxToMinModel.adjrsq", "fun.MaxToMinModel.rsq", "fun.plot.circle", "fun.results", "fun.rs.dcor", "fun.vectorcoerce", "group", "height", "i", "j", "k", "ls", "ls.boot", "ls1", "lst.boot.result", "oldwd", "regressor.names", "response.name", "result.df", "rs.dcor", "source.filename", "tbl.bt", "tbl.nm")
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-02T09:05:32+00:00Added an answer on June 2, 2026 at 9:05 am

    One possibility is that you have copied the function ls(), i.e.

    ls = ls
    

    This reproduces your “problems” So

    get("ls")
    

    returns a function. You get the same error messages:

    R> get("ls", mode="numeric")
    Error in get("ls", mode = "numeric") : 
      object 'ls' of mode 'numeric' was not found
    R> get("ls", mode=!"function")
    Error in !"function" : invalid argument type
    

    and the dput gives the same result:

    R> dput(ls()[grep("^ls$", ls())]) 
    "ls"
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using git / github and by accident I have been committing into
By accident I called svn import ... in the wrong directory. Is there a
Sorry I missed and deleted earlier question on accident again. I have a situation,
i used ftp-get function to download images from server. But by accident i used
There was an accident and I lost my SVN repo directory, though my source
I must have skipped a page or two by accident during my PDF Tutorials
I pulled changes, and merged conflicts by accident. The result: I have a bunch
I have a ComboBox. It is critical that the user cannot scroll by accident
We've developed a system which involves the customer using a tool to create their
I have, by accident, exported and imported my colleague's developer identity into Xcode Organizer.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.