如何解决R语言中 the following objects are masked from data (pos=3)?

Python026

如何解决R语言中 the following objects are masked from data (pos=3)?,第1张

R objects that reside in other R objects can require a lot of typing to access. For example, to refer to a variable x in a dataframe df , one could type df$x . This is no problem when the dataframe and variable names are short, but can become burdensome when longer names or repeated references are required, or objects in complicated structures must be accessed. The attach() function in R can be used to make objects within dataframes accessible in R with fewer keystrokes. As an example: ... then detach() the dataset to clean up after ourselves. 之后,用命令 detach() 结束使用数据集。 users are cautioned that if there is already a variable called cesd in the local workspace, issuing attach(ds) , may not mean that cesd references ds$cesd . Name conflicts of this type are a common problem with attach() and care should be taken to avoid them. The help page for attach() notes that attach can lead to confusion . The Google R Style Manual provides clear advice on this point, providing the following advice about attach() : The possibilities for creating errors when using attach are numerous. Avoid it.So what options exist for those who decide to go cold turkey? 那么,有哪些应对方法呢? (Also note the within() function, which is similar to with() , but returns a modified object.) Some examples may be helpful: 比如下面这个例子: In short, there’s never an actual need to use attach() , using it can lead to confusion or errors, and alternatives exists that avoid the problems. We recommend against it. 详细语法可以在R中输入 ??with 查看。 文献参考: https://www.r-bloggers.com/to-attach-or-not-attach-that-is-the-question/

在VC中点击“Tools”—>“Option”—>“Directories”,发现路径有误,重新设置“Excutable Fils,Include Files,Library Files,Source Files”的路径。

如果你是按照初始路径安装vc6.0的,路径应为:

executatble files:

C:\Program Files\Microsoft Visual Studio\Common\MSDev98\Bin

C:\Program Files\Microsoft Visual Studio\VC98\BIN

C:\Program Files\Microsoft Visual Studio\Common\TOOLS

C:\Program Files\Microsoft Visual Studio\Common\TOOLS\WINNT

include files:

C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE

C:\Program Files\Microsoft Visual Studio\VC98\MFC\INCLUDE

C:\Program Files\Microsoft Visual Studio\VC98\ATL\INCLUDE

library files:

C:\Program Files\Microsoft Visual Studio\VC98\LIB

C:\Program Files\Microsoft Visual Studio\VC98\MFC\LIB

source files:

C:\Program Files\Microsoft Visual Studio\VC98\MFC\SRC

C:\Program Files\Microsoft Visual Studio\VC98\MFC\INCLUDE

C:\Program Files\Microsoft Visual Studio\VC98\ATL\INCLUDE

C:\Program Files\Microsoft Visual Studio\VC98\CRT\SRC

如果你装在其他盘里,则仿照其路径变通就行。

关键是microsoft visual studio\ 后面的东西要相同。