rm() doesn't seem to empty my R workspace

前端 未结 1 1212
滥情空心
滥情空心 2021-01-20 18:30

I\'m trying to clear my R workspace. Nothing I\'ve found in any thread seems to work - and I\'ve been googling and trying solutions for hours now :(

When I open R an

1条回答
  •  一生所求
    2021-01-20 19:21

    What you are seeing is the source code for the ls function. When you enter a function name without the parentheses, you'll see the complete source code for that function (provided that function is in one of the packages attached to the search path, or in the global environment).

    When you see character(0) as the result of calling ls(), that means that there are no objects in the global environment. The base package, where ls calls home, is different from the global environment, and objects there cannot be removed.

    When character(0) is the result of ls() after you call rm(list=ls()), you have successfully cleared the objects in the global environment.

    0 讨论(0)
提交回复
热议问题