Curly braces around package name convention

There seem to exist a convention to put curly braces around an R package name when discussing it in various contexts, as in: {dplyr}. For example, in this Tweet or that blog post.

I feel it's somewhat recent, I don't remember seeing it before 1-2 years ago. Where does it come from? Is it as new as I thought? Is there a context (vignette etc) where it is interpreted in a special way?

This was discussed in another topic recently, but that topic doesn't contain answers to these questions.

1 Like

It’s something that those of us trying to figure out the secret handshake for the cool kids club do. {ggplot2} isn’t really as useful as ggplot2 and, besides the curly braces are syntactic and we probably shouldn’t try to show off like this.

4 Likes

This is how package names are presented on the top left corner of the R help on your computer.
Like with ?sort here:

Using it allows students to distinguish between normal text, package names and function names when your present it in your courses. See the difference by yourself, and choose your own way.

  • Let me present you ggplot2. You can use ggplot to create a plot: gg. We also use here in here and glue in glue in the exercise.
  • Let me present you {ggplot2}. You can use ggplot() to create a plot: gg. We also use here() in {here} and glue() in {glue} in the exercise.

When you teach, you need to think about newcomers and give them some references, some guidance on what you are talking about. Because they discover so many concepts. For you, the difference between a package, a function, an object is clear. For them, this is totally new. If you have visual concepts to make them more easily identify things in your slides, it will be better for their understanding.

  • package: {ggplot2}
  • function: ggplot()
  • object: gg
  • directory: "results/"

You can decide your own way of presenting it.

5 Likes

Ah! The brace thing is actually so ubiquitous as to be invisible!

Yes it does sound like a secret handshake, but I want to be a cool kid too!

1 Like

This is how package names are presented on the top left corner of the R help on your computer.

Oh I never noticed! Yes, it makes total sense to use different notations, but I had no idea where this one came from.

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.