我对.Rprofile中的语句与常规代码有如此不同的影响感到困惑。具体来说,我想在.Rprofile中包含library("dplyr")
以使其始终在OSX中加载。
.Rprofile的效果如下:
library("lubridate")
library("dplyr")
是:
Attaching package: ‘dplyr’
The following objects are masked from ‘package:lubridate’:
intersect, setdiff, union
The following objects are masked from ‘package:base’:
intersect, setdiff, setequal, union
如果.Rprofile只有library("lubridate")
,则library("dplyr")
作为R会话中的第一个语句的效果是:
Attaching package: ‘dplyr’
The following object is masked from ‘package:stats’:
filter
The following objects are masked from ‘package:lubridate’:
intersect, setdiff, union
The following objects are masked from ‘package:base’:
intersect, setdiff, setequal, union
因此,像filter
这样的dplyr命令无法正常工作。这是为什么?