If I create a variable with a backtick in the name, is there a way to access it using the backtick syntax?
assign("a`b", 5)
get("a`b")
#[1] 5
# The attempts below all end in various errors
# `a`b`
# `a``b`
# `a\\`b`
Alternatively known as acute, backtick, left quote, or an open quote, the back quote or backquote is a punctuation mark (`). It's on the same U.S. computer keyboard key as the tilde.
backticks are used to indicate that the text between the backticks should be executed as a command. '['(women, 1:5, 1) "["(women, 1:5, 1) Copy [1] 58 59 60 61 62 [1] 58 59 60 61 62. It also turns out that ( is a function as well, which was what I surmised in my previous post.
As a bonus, you can also set the functions of an Addin to custom keyboard shortcuts and quickly access them from the RStudio command palette (just hit Shift + Cmd + P , or Shift + Ctrl + P , then type the word 'backtick').
Output. According to this resource, it says that you can't start variable names with $ in C, which is wrong (at least when compiled using my gcc version, Apple LLVM version 10.0. 1 (clang-1001.0. 46.4)).
All your attempts end in various errors because ?Quotes
says that you can only escape the characters listed in the (included) table; and "`"
is not in that table.
You could use the hex, octal, etc. representation of "`"
though:
> `a\x60b` # hex
[1] 5
> `a\140b` # octal
[1] 5
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With