rm(list=ls()) doesn't completely clear the workspace

前端 未结 7 1347
一向
一向 2020-12-08 04:36

This is a very minor issue, but I would like to understand exactly what is going on here.

Say I do the following:

library(RMySQL)
con <- dbConnect         


        
7条回答
  •  旧巷少年郎
    2020-12-08 05:16

    Most likely you have at least one other data frame or list attached with x and y columns/components. You can use the "conflicts" function to see all objects that have potential conflicts and use the "find" function to find out where those objects are (the "search" function also helps by showing all the things you have attached).

    Your question is a good example of why attaching data frames is being frowned upon, it is better to use functions like "with" or "within" so that you don't have problems from forgetting to detach objects.

提交回复
热议问题