Skip to main content

Current Chapter

Current chapter – Best practice and further information


The following best practice should be observed to help you work in RStudio efficiently.

Following a consistent style

Following a consistent style makes your code more readable and makes collaboration with others easier. Name variables, functions, or files consistently, for example, use underscores and use names that are concise and easily identifiable.

Testing your code

Test your code to ensure it works before you run it on RStudio.

Use a testing framework such as ‘testthat’ so the code can be easily re-tested later.

You can also refer to the RStudio testthat article for further information.


Further information

For further support on RStudio, visit the RStudio website

Data awareness training

The Safe Data Access Professionals Group helps share expertise, best practice and knowledge between organisations engaged in providing secure access to confidential sources of data from the health and social science research sector.

These free data awareness training courses and modules provide you with best practice information on working with statistical data and can be accessed on the Secure Data Group website.


Last edited: 12 February 2025 1:40 pm