scope - What are the double colons (::) in R? -
i following tutorial in rbloggers , found use of double colons, looked online, couldn't find explanation use. here example of use.
df <- dplyr::data_frame( year = c(2015, na, na, na), trt = c("a", na, "b", na) )
i understand creates data frame don't understand purpose.
as have looked page usage of ::
helps access exact function specific package. when load dplyr
got message the
the following objects masked ‘package:base’: intersect, setdiff, setequal, union
so, instance use respective intersect functions ...the usage follows
mtcars$model <- rownames(mtcars) first <- mtcars[1:20, ] second <- mtcars[10:20, ] dplyr::intersect(first, second) base::intersect(first, second)
run , check differences. here resources understanding.
Comments
Post a Comment