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.

compare library(), require(), ::

namespace


Comments

Popular posts from this blog

sublimetext3 - what keyboard shortcut is to comment/uncomment for this script tag in sublime -

java - No use of nillable="0" in SOAP Webservice -

ubuntu - Laravel 5.2 quickstart guide gives Not Found Error -