[R] Where did lost variables go, with example

Duncan Murdoch murdoch.duncan at gmail.com
Tue Dec 31 17:32:04 CET 2013


On 13-12-31 9:48 AM, David Parkhurst wrote:
> Two or three respondents asked for an example of my problem.  Here's
> what's happening to me now.  I can't reproduce how I got to this point,
> though:
>
>   > ls()
> [1] "All8"   "All8Sites"  "A"   "B"  "C"  "i"  "n"  "D"  "F"
>   > X
> Error: object 'X' not found
>   > attach(All8Sites)
>   > ls()
> [1] "All8"  "All8Sites"  "A"  "B"  "C"  "i"  "n"  "D"  "F"
>
>
> "X" is one of the variables in the data frame I attached in the third
> command above, but it's not listed by >ls().  If I enter > X now, its
> values ARE listed, but it's hiding somewhere.  What is happening here?
> How can I get the variables in that data frame listed when I attach it?

Use search() to see the search list.  Your dataframe will likely be in 
position 2.  Use ls(2) to see the variables there.

Duncan Murdoch



More information about the R-help mailing list