0

I am struggling to google search what the '::' and what the '!!' do within the Dplyr package or R in general. ( I am very new to R).

    dplyr::select(Level, Effect) %>%
    rename(!!colname := Effect,
           !!effect := Level)
Gregor Thomas
  • 136,190
  • 20
  • 167
  • 294
emw
  • 1
  • 1
  • 4
    Please enter `?\`::\`` and `?\`!!\`` in your R console. – ismirsehregal Oct 12 '22 at 12:47
  • `::` is used to specify a function from a package. `dplyr::select` means "the `select` function from the `dplyr` package". It's sometimes necessary to use `::` if you have 2 (or more) packages loaded that use the same function name for different functions. – Gregor Thomas Oct 12 '22 at 12:52
  • 2
    `!!` and `:=` are a little more complicated, I'd suggest reading [Programming with dplyr](https://dplyr.tidyverse.org/articles/programming.html) to get a strong intro to them. – Gregor Thomas Oct 12 '22 at 12:55

0 Answers0