R: What do you call the :: and ::: operators and how do they differ? [duplicate]What are the double colons (::) in R?blogdown index.Rmd uses `:::` instead of `::` to specify package, Why?What is dependency injection?Which equals operator (== vs ===) should be used in JavaScript comparisons?Does Python have a ternary conditional operator?What is the !! (not not) operator in JavaScript?What is the “-->” operator in C++?What is JSONP, and why was it created?Reference — What does this symbol mean in PHP?What are the basic rules and idioms for operator overloading?What does the C ??!??! operator do?Why don't Java's +=, -=, *=, /= compound assignment operators require casting?
Why are electrically insulating heatsinks so rare? Is it just cost?
What's the output of a record cartridge playing an out-of-speed record
What are these boxed doors outside store fronts in New York?
How to find program name(s) of an installed package?
Adding span tags within wp_list_pages list items
Is it important to consider tone, melody, and musical form while writing a song?
What does it mean to describe someone as a butt steak?
How is it possible to have an ability score that is less than 3?
Why Is Death Allowed In the Matrix?
Has the BBC provided arguments for saying Brexit being cancelled is unlikely?
"to be prejudice towards/against someone" vs "to be prejudiced against/towards someone"
How can bays and straits be determined in a procedurally generated map?
Writing rule stating superpower from different root cause is bad writing
Which models of the Boeing 737 are still in production?
How does strength of boric acid solution increase in presence of salicylic acid?
What would happen to a modern skyscraper if it rains micro blackholes?
Why "Having chlorophyll without photosynthesis is actually very dangerous" and "like living with a bomb"?
Why did the Germans forbid the possession of pet pigeons in Rostov-on-Don in 1941?
Do I have a twin with permutated remainders?
How do we improve the relationship with a client software team that performs poorly and is becoming less collaborative?
Accidentally leaked the solution to an assignment, what to do now? (I'm the prof)
Prove that NP is closed under karp reduction?
Is it unprofessional to ask if a job posting on GlassDoor is real?
Why are 150k or 200k jobs considered good when there are 300k+ births a month?
R: What do you call the :: and ::: operators and how do they differ? [duplicate]
What are the double colons (::) in R?blogdown index.Rmd uses `:::` instead of `::` to specify package, Why?What is dependency injection?Which equals operator (== vs ===) should be used in JavaScript comparisons?Does Python have a ternary conditional operator?What is the !! (not not) operator in JavaScript?What is the “-->” operator in C++?What is JSONP, and why was it created?Reference — What does this symbol mean in PHP?What are the basic rules and idioms for operator overloading?What does the C ??!??! operator do?Why don't Java's +=, -=, *=, /= compound assignment operators require casting?
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;
This question already has an answer here:
What are the double colons (::) in R?
2 answers
I'm wondering how the functions of the ::
and :::
operators differ in R.
However, I can't figure out what these operators are called and so a google or SO search has not proven helpful. I also get an error when I try ?::
in R.
So...
What are the
::
and:::
operators called?How do
::
and:::
differ? (i.e., what exactly does each do)?
r operators terminology
marked as duplicate by hrbrmstr
StackExchange.ready(function()
if (StackExchange.options.isMobile) return;
$('.dupe-hammer-message-hover:not(.hover-bound)').each(function()
var $hover = $(this).addClass('hover-bound'),
$msg = $hover.siblings('.dupe-hammer-message');
$hover.hover(
function()
$hover.showInfoMessage('',
messageElement: $msg.clone().show(),
transient: false,
position: my: 'bottom left', at: 'top center', offsetTop: -7 ,
dismissable: false,
relativeToBody: true
);
,
function()
StackExchange.helpers.removeMessages();
);
);
);
Jan 11 '17 at 4:07
This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.
add a comment |
This question already has an answer here:
What are the double colons (::) in R?
2 answers
I'm wondering how the functions of the ::
and :::
operators differ in R.
However, I can't figure out what these operators are called and so a google or SO search has not proven helpful. I also get an error when I try ?::
in R.
So...
What are the
::
and:::
operators called?How do
::
and:::
differ? (i.e., what exactly does each do)?
r operators terminology
marked as duplicate by hrbrmstr
StackExchange.ready(function()
if (StackExchange.options.isMobile) return;
$('.dupe-hammer-message-hover:not(.hover-bound)').each(function()
var $hover = $(this).addClass('hover-bound'),
$msg = $hover.siblings('.dupe-hammer-message');
$hover.hover(
function()
$hover.showInfoMessage('',
messageElement: $msg.clone().show(),
transient: false,
position: my: 'bottom left', at: 'top center', offsetTop: -7 ,
dismissable: false,
relativeToBody: true
);
,
function()
StackExchange.helpers.removeMessages();
);
);
);
Jan 11 '17 at 4:07
This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.
2
what-are-the-double-colons-in-r stackoverflow.com/questions/35240971/…
– thelatemail
Jan 11 '17 at 3:20
1
@hrbrmstr Though I certainly agree that the two questions should be linked, I disagree that my question should be closed as a duplicate. My question is really asking a separate question not asked nor answered in the question you've linked. My question asks how the two colon operators differ.
– theforestecologist
Jan 11 '17 at 4:12
"see the help files... ?'::' " (the first comment) is all you needed from that link. it's def a dup. petition to have it reopened. i'm sure you'll find some sympathetic moderators.
– hrbrmstr
Jan 11 '17 at 4:18
add a comment |
This question already has an answer here:
What are the double colons (::) in R?
2 answers
I'm wondering how the functions of the ::
and :::
operators differ in R.
However, I can't figure out what these operators are called and so a google or SO search has not proven helpful. I also get an error when I try ?::
in R.
So...
What are the
::
and:::
operators called?How do
::
and:::
differ? (i.e., what exactly does each do)?
r operators terminology
This question already has an answer here:
What are the double colons (::) in R?
2 answers
I'm wondering how the functions of the ::
and :::
operators differ in R.
However, I can't figure out what these operators are called and so a google or SO search has not proven helpful. I also get an error when I try ?::
in R.
So...
What are the
::
and:::
operators called?How do
::
and:::
differ? (i.e., what exactly does each do)?
This question already has an answer here:
What are the double colons (::) in R?
2 answers
r operators terminology
r operators terminology
edited Jan 12 '17 at 3:24
theforestecologist
asked Jan 11 '17 at 3:18
theforestecologisttheforestecologist
1,73222648
1,73222648
marked as duplicate by hrbrmstr
StackExchange.ready(function()
if (StackExchange.options.isMobile) return;
$('.dupe-hammer-message-hover:not(.hover-bound)').each(function()
var $hover = $(this).addClass('hover-bound'),
$msg = $hover.siblings('.dupe-hammer-message');
$hover.hover(
function()
$hover.showInfoMessage('',
messageElement: $msg.clone().show(),
transient: false,
position: my: 'bottom left', at: 'top center', offsetTop: -7 ,
dismissable: false,
relativeToBody: true
);
,
function()
StackExchange.helpers.removeMessages();
);
);
);
Jan 11 '17 at 4:07
This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.
marked as duplicate by hrbrmstr
StackExchange.ready(function()
if (StackExchange.options.isMobile) return;
$('.dupe-hammer-message-hover:not(.hover-bound)').each(function()
var $hover = $(this).addClass('hover-bound'),
$msg = $hover.siblings('.dupe-hammer-message');
$hover.hover(
function()
$hover.showInfoMessage('',
messageElement: $msg.clone().show(),
transient: false,
position: my: 'bottom left', at: 'top center', offsetTop: -7 ,
dismissable: false,
relativeToBody: true
);
,
function()
StackExchange.helpers.removeMessages();
);
);
);
Jan 11 '17 at 4:07
This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.
2
what-are-the-double-colons-in-r stackoverflow.com/questions/35240971/…
– thelatemail
Jan 11 '17 at 3:20
1
@hrbrmstr Though I certainly agree that the two questions should be linked, I disagree that my question should be closed as a duplicate. My question is really asking a separate question not asked nor answered in the question you've linked. My question asks how the two colon operators differ.
– theforestecologist
Jan 11 '17 at 4:12
"see the help files... ?'::' " (the first comment) is all you needed from that link. it's def a dup. petition to have it reopened. i'm sure you'll find some sympathetic moderators.
– hrbrmstr
Jan 11 '17 at 4:18
add a comment |
2
what-are-the-double-colons-in-r stackoverflow.com/questions/35240971/…
– thelatemail
Jan 11 '17 at 3:20
1
@hrbrmstr Though I certainly agree that the two questions should be linked, I disagree that my question should be closed as a duplicate. My question is really asking a separate question not asked nor answered in the question you've linked. My question asks how the two colon operators differ.
– theforestecologist
Jan 11 '17 at 4:12
"see the help files... ?'::' " (the first comment) is all you needed from that link. it's def a dup. petition to have it reopened. i'm sure you'll find some sympathetic moderators.
– hrbrmstr
Jan 11 '17 at 4:18
2
2
what-are-the-double-colons-in-r stackoverflow.com/questions/35240971/…
– thelatemail
Jan 11 '17 at 3:20
what-are-the-double-colons-in-r stackoverflow.com/questions/35240971/…
– thelatemail
Jan 11 '17 at 3:20
1
1
@hrbrmstr Though I certainly agree that the two questions should be linked, I disagree that my question should be closed as a duplicate. My question is really asking a separate question not asked nor answered in the question you've linked. My question asks how the two colon operators differ.
– theforestecologist
Jan 11 '17 at 4:12
@hrbrmstr Though I certainly agree that the two questions should be linked, I disagree that my question should be closed as a duplicate. My question is really asking a separate question not asked nor answered in the question you've linked. My question asks how the two colon operators differ.
– theforestecologist
Jan 11 '17 at 4:12
"see the help files... ?'::' " (the first comment) is all you needed from that link. it's def a dup. petition to have it reopened. i'm sure you'll find some sympathetic moderators.
– hrbrmstr
Jan 11 '17 at 4:18
"see the help files... ?'::' " (the first comment) is all you needed from that link. it's def a dup. petition to have it reopened. i'm sure you'll find some sympathetic moderators.
– hrbrmstr
Jan 11 '17 at 4:18
add a comment |
1 Answer
1
active
oldest
votes
It turns out there is a unique way to access help info for operators such as these colons: add quotations marks around the operator. [E.g., ?'::'
or help(":::")
].
- Also, instead of quotation marks, back-ticks (i.e, ` ) also work.
Double Colon Operator and Triple Colon Operator
The answer to the question can be found on the help page for "Double Colon and Triple Colon Operators" (see here).
For a package pkg, pkg::name returns the value of the exported variable name in namespace pkg, whereas pkg:::name returns the value of the internal variable name. The package namespace will be loaded if it was not loaded before the call, but the package will not be attached to the search path.
The difference can be seen by examining the code of each:
> `::`
function (pkg, name)
pkg <- as.character(substitute(pkg))
name <- as.character(substitute(name))
getExportedValue(pkg, name)
<bytecode: 0x00000000136e2ae8>
<environment: namespace:base>
> `:::`
function (pkg, name)
pkg <- as.character(substitute(pkg))
name <- as.character(substitute(name))
get(name, envir = asNamespace(pkg), inherits = FALSE)
<bytecode: 0x0000000013482f50>
<environment: namespace:base>
:: calls getExportedValue(pkg, name)
, returning the value of the exported variable name
in the package's namespace.
::: calls get(name, envir = asNamespace(pkg), inherits = FALSE)
, searching for the object name
in the Namespace environment of the package, and returning the value of the internal variable name
.
So, what exactly is a namespace?
This site does a good job of explaining the concept of namespaces in R. Importantly:
As the name suggests, namespaces provide “spaces” for “names”. They provide a context for looking up the value of an object associated with a name.
4
It means you can do ridiculous things like`::`("stats","sd")(1:5)
which is equivalent tosd(1:5)
– thelatemail
Jan 11 '17 at 3:31
add a comment |
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
It turns out there is a unique way to access help info for operators such as these colons: add quotations marks around the operator. [E.g., ?'::'
or help(":::")
].
- Also, instead of quotation marks, back-ticks (i.e, ` ) also work.
Double Colon Operator and Triple Colon Operator
The answer to the question can be found on the help page for "Double Colon and Triple Colon Operators" (see here).
For a package pkg, pkg::name returns the value of the exported variable name in namespace pkg, whereas pkg:::name returns the value of the internal variable name. The package namespace will be loaded if it was not loaded before the call, but the package will not be attached to the search path.
The difference can be seen by examining the code of each:
> `::`
function (pkg, name)
pkg <- as.character(substitute(pkg))
name <- as.character(substitute(name))
getExportedValue(pkg, name)
<bytecode: 0x00000000136e2ae8>
<environment: namespace:base>
> `:::`
function (pkg, name)
pkg <- as.character(substitute(pkg))
name <- as.character(substitute(name))
get(name, envir = asNamespace(pkg), inherits = FALSE)
<bytecode: 0x0000000013482f50>
<environment: namespace:base>
:: calls getExportedValue(pkg, name)
, returning the value of the exported variable name
in the package's namespace.
::: calls get(name, envir = asNamespace(pkg), inherits = FALSE)
, searching for the object name
in the Namespace environment of the package, and returning the value of the internal variable name
.
So, what exactly is a namespace?
This site does a good job of explaining the concept of namespaces in R. Importantly:
As the name suggests, namespaces provide “spaces” for “names”. They provide a context for looking up the value of an object associated with a name.
4
It means you can do ridiculous things like`::`("stats","sd")(1:5)
which is equivalent tosd(1:5)
– thelatemail
Jan 11 '17 at 3:31
add a comment |
It turns out there is a unique way to access help info for operators such as these colons: add quotations marks around the operator. [E.g., ?'::'
or help(":::")
].
- Also, instead of quotation marks, back-ticks (i.e, ` ) also work.
Double Colon Operator and Triple Colon Operator
The answer to the question can be found on the help page for "Double Colon and Triple Colon Operators" (see here).
For a package pkg, pkg::name returns the value of the exported variable name in namespace pkg, whereas pkg:::name returns the value of the internal variable name. The package namespace will be loaded if it was not loaded before the call, but the package will not be attached to the search path.
The difference can be seen by examining the code of each:
> `::`
function (pkg, name)
pkg <- as.character(substitute(pkg))
name <- as.character(substitute(name))
getExportedValue(pkg, name)
<bytecode: 0x00000000136e2ae8>
<environment: namespace:base>
> `:::`
function (pkg, name)
pkg <- as.character(substitute(pkg))
name <- as.character(substitute(name))
get(name, envir = asNamespace(pkg), inherits = FALSE)
<bytecode: 0x0000000013482f50>
<environment: namespace:base>
:: calls getExportedValue(pkg, name)
, returning the value of the exported variable name
in the package's namespace.
::: calls get(name, envir = asNamespace(pkg), inherits = FALSE)
, searching for the object name
in the Namespace environment of the package, and returning the value of the internal variable name
.
So, what exactly is a namespace?
This site does a good job of explaining the concept of namespaces in R. Importantly:
As the name suggests, namespaces provide “spaces” for “names”. They provide a context for looking up the value of an object associated with a name.
4
It means you can do ridiculous things like`::`("stats","sd")(1:5)
which is equivalent tosd(1:5)
– thelatemail
Jan 11 '17 at 3:31
add a comment |
It turns out there is a unique way to access help info for operators such as these colons: add quotations marks around the operator. [E.g., ?'::'
or help(":::")
].
- Also, instead of quotation marks, back-ticks (i.e, ` ) also work.
Double Colon Operator and Triple Colon Operator
The answer to the question can be found on the help page for "Double Colon and Triple Colon Operators" (see here).
For a package pkg, pkg::name returns the value of the exported variable name in namespace pkg, whereas pkg:::name returns the value of the internal variable name. The package namespace will be loaded if it was not loaded before the call, but the package will not be attached to the search path.
The difference can be seen by examining the code of each:
> `::`
function (pkg, name)
pkg <- as.character(substitute(pkg))
name <- as.character(substitute(name))
getExportedValue(pkg, name)
<bytecode: 0x00000000136e2ae8>
<environment: namespace:base>
> `:::`
function (pkg, name)
pkg <- as.character(substitute(pkg))
name <- as.character(substitute(name))
get(name, envir = asNamespace(pkg), inherits = FALSE)
<bytecode: 0x0000000013482f50>
<environment: namespace:base>
:: calls getExportedValue(pkg, name)
, returning the value of the exported variable name
in the package's namespace.
::: calls get(name, envir = asNamespace(pkg), inherits = FALSE)
, searching for the object name
in the Namespace environment of the package, and returning the value of the internal variable name
.
So, what exactly is a namespace?
This site does a good job of explaining the concept of namespaces in R. Importantly:
As the name suggests, namespaces provide “spaces” for “names”. They provide a context for looking up the value of an object associated with a name.
It turns out there is a unique way to access help info for operators such as these colons: add quotations marks around the operator. [E.g., ?'::'
or help(":::")
].
- Also, instead of quotation marks, back-ticks (i.e, ` ) also work.
Double Colon Operator and Triple Colon Operator
The answer to the question can be found on the help page for "Double Colon and Triple Colon Operators" (see here).
For a package pkg, pkg::name returns the value of the exported variable name in namespace pkg, whereas pkg:::name returns the value of the internal variable name. The package namespace will be loaded if it was not loaded before the call, but the package will not be attached to the search path.
The difference can be seen by examining the code of each:
> `::`
function (pkg, name)
pkg <- as.character(substitute(pkg))
name <- as.character(substitute(name))
getExportedValue(pkg, name)
<bytecode: 0x00000000136e2ae8>
<environment: namespace:base>
> `:::`
function (pkg, name)
pkg <- as.character(substitute(pkg))
name <- as.character(substitute(name))
get(name, envir = asNamespace(pkg), inherits = FALSE)
<bytecode: 0x0000000013482f50>
<environment: namespace:base>
:: calls getExportedValue(pkg, name)
, returning the value of the exported variable name
in the package's namespace.
::: calls get(name, envir = asNamespace(pkg), inherits = FALSE)
, searching for the object name
in the Namespace environment of the package, and returning the value of the internal variable name
.
So, what exactly is a namespace?
This site does a good job of explaining the concept of namespaces in R. Importantly:
As the name suggests, namespaces provide “spaces” for “names”. They provide a context for looking up the value of an object associated with a name.
edited Nov 15 '18 at 18:32
Jeff Hammerbacher
3,38822532
3,38822532
answered Jan 11 '17 at 3:24
theforestecologisttheforestecologist
1,73222648
1,73222648
4
It means you can do ridiculous things like`::`("stats","sd")(1:5)
which is equivalent tosd(1:5)
– thelatemail
Jan 11 '17 at 3:31
add a comment |
4
It means you can do ridiculous things like`::`("stats","sd")(1:5)
which is equivalent tosd(1:5)
– thelatemail
Jan 11 '17 at 3:31
4
4
It means you can do ridiculous things like
`::`("stats","sd")(1:5)
which is equivalent to sd(1:5)
– thelatemail
Jan 11 '17 at 3:31
It means you can do ridiculous things like
`::`("stats","sd")(1:5)
which is equivalent to sd(1:5)
– thelatemail
Jan 11 '17 at 3:31
add a comment |
2
what-are-the-double-colons-in-r stackoverflow.com/questions/35240971/…
– thelatemail
Jan 11 '17 at 3:20
1
@hrbrmstr Though I certainly agree that the two questions should be linked, I disagree that my question should be closed as a duplicate. My question is really asking a separate question not asked nor answered in the question you've linked. My question asks how the two colon operators differ.
– theforestecologist
Jan 11 '17 at 4:12
"see the help files... ?'::' " (the first comment) is all you needed from that link. it's def a dup. petition to have it reopened. i'm sure you'll find some sympathetic moderators.
– hrbrmstr
Jan 11 '17 at 4:18