The following object is masked from myData (pos =4):

Hi, and welcome!

Please see the FAQ: What's a reproducible example (`reprex`) and how do I do one? Using a reprex, complete with representative data will attract quicker and more answers. This one doesn't strictly require one, but requires some speculation on my part.

If you try to attach a variable from a data frame with a name that conflicts with a reserved name, such as data, you might well see this.

Second, attach is not an optimal approach to dealing with related data. Besides the initial proliferation of data that's already available within the source object, it presents unnecessary complexity in gluing pieces back together.

An alternative is my_data$name to extract a single variable, which has the advantage of neither conflicting with the reserved name or adding another variable to the namespace.

1 Like