Hi,
I'm new in R and just started with R 3.6.2 and R Studio 1.2.5033 and get this error
Error in filter(.data = tmps, CN == "CL" & GTTF != "") :
unused argument (.data = tmps)
when I use "library(dplyr)" in my ".Rprofile".
When I don't use ".Rprofile" and manually run "library(dplyr)" it works.
The start-up message from RStudio (when loading dplyr) is different - missing filter, lag ...
Why?
I want to avoid always loading dplyr so I've used this solution.
Thanks
Details:
R_LIBS is set to "C:\TWS\Libs\R"
R_USER is set to L:\myname\Configs\R
I also had set R_PROFILE_USER but same problem.
Version 1: I have a .Rprofile within R_USER which only contains "library(dplyr)":
Start RStudio:
Attaching package: ‘dplyr’
The following objects are masked from ‘package:base’:
intersect, setdiff, setequal, union
> # Read data file
> toto <- read.table(
+ file = paste0(Sys.getenv("TOTO_DATA_PATH"), "/Toto.csv"),
+ header = TRUE,
+ sep = "\t",
+ quote = "",
+ dec = "."
+ )
> tmps <- select(
+ .data = toto,
+ CN,GTTG,GTSO,GTTF
+ )
> head(tmps)
CN GTTG GTSO GTTF
1 CI 4 H R
2 CI 5 H F
3 CI 4 A F
4 CI 3 A F
5 CI 4 A R
6 CI 3 H V
> tmpf <- filter(
+ .data = tmps,
+ CN == "CL" & GTTF != ""
+ )
Error in filter(.data = tmps, CN == "CL" & GTTF != "") :
unused argument (.data = tmps)
>
Version 2: I have no .Rprofile within R_USER:
Start RStudio:
> library(dplyr)
Attaching package: ‘dplyr’
The following objects are masked from ‘package:stats’:
filter, lag
The following objects are masked from ‘package:base’:
intersect, setdiff, setequal, union
> # Read data file
> toto <- read.table(
+ file = paste0(Sys.getenv("TOTO_DATA_PATH"), "/Toto.csv"),
+ header = TRUE,
+ sep = "\t",
+ quote = "",
+ dec = "."
+ )
> tmps <- select(
+ .data = toto,
+ CN,GTTG,GTSO,GTTF
+ )
> head(tmps)
CN GTTG GTSO GTTF
1 CI 4 H R
2 CI 5 H F
3 CI 4 A F
4 CI 3 A F
5 CI 4 A R
6 CI 3 H V
> tmpf <- filter(
+ .data = tmps,
+ CN == "CL" & GTTF != ""
+ )
> head(tmpf)
CN GTTG GTSO GTTF
1 CL 4 A F
2 CL 7 A F
3 CL 4 H F
4 CL 3 H F
5 CL 4 H F
6 CL 4 H F