R RStudio

How to modify or create RStudio code snippets

RStudio snippets are very handy when it comes to dealing with repetitive tasks. Here is how to modify RStudio snippets or create a new one.

In my case, there was a problem with the format that I get by using the ts snippet.

Modify RStudio snippets

To change or create new snippet go to Tools -> Global Options -> Code -> Edit Snippets.

After that, I located the ts snippet.

To get my desired date-time format, I replaced the date function with this and saved snippets.

format(Sys.time(), format = "%Y-%m-%d %H:%M:%S")

You can enhance productivity in RStudio by making RProfile modifications. Take a look at this post on how to do that and why.

1 comment on “How to modify or create RStudio code snippets

  1. […] Thank you for reading this and check out this other post on how to modify or create RStudio code snippets. […]

Leave a Reply

Your email address will not be published. Required fields are marked *