If you have any masked objects then you might have problems executing certain functions because they will use the masked object rather than the data frame that you have intended to use. For example, when trying to execute the linear mixed-effects model function I got the following error after running the code.
hsb12g <- groupedData(mathach ~ ses | school, data = hsb12) lme(mathach ~ ses, data = hsb12g, random = ~ 1 | school) Warning messages: only the first of 5 elements used for string value in: c("model", "make", "mph", "weight", "price") Problem in getFunction(FUN): couldn't find function definition for "model" Use traceback() to see the call stack
It was very suspicious that the data that the error message indicated that the function was calling a data frame that looked like a data frame called names which had been created earlier and was no longer useful. Thus, the suspicion was that instead of using the hsb12 data frame specified in the lme function SPLUS was using the names data frame. This would be the case if for some reason the names data frame had been masked. By being masked the data frame was first in the search list and it was masking all the other data frames, in other words, the function was seeing only one available data frame namely names. The masked() function was used to find out if there were any data frames or objects being masked. From the output of masked it becomes apparent that the names data frame is indeed masked and it is probably being used inappropriately for our analyses. The solution to this problem is to simply remove the object which is masked by using the remove function. After we have removed the names data frame we can use the masked function to check that this object is no longer being masked.
masked() [1] ".Last.value" ".Random.seed" "names" remove("names") masked() [1] ".Last.value" ".Random.seed"