What are the common files used in R?

What are the common files used in R?

Answered in Getting Started in R and Rstudio course: https://learnadv.com/courses/getting-started-with-r-and-rstudio/

R scripts (.R files)
In most uses of R, we create scripts. Scripts are a collection of code and functions written in the R language that can be interpreted by the R software. We call the process of creating these scripts, coding.

Scripts can achieve any number of goals such as manipulating a data set, conducting a statistical analysis, or visualizing the results of your research. Scripts are kept in R as a .R file.

R Markdown (.Rmd files)
RMarkdown objects are a more powerful extension of scripts that allow you to run segments of code (called chunks) alongside text. RMarkdown files can also be exported into PDF, html, or even word documents. Once exported, they retain all of the text and code while also displaying the results from the chunks.

Data files (.RData)
As we will learn, R allows the creation of many different objects. These objects could be data sets, results from analyses, or visualizations related to your study! We can save these objects into data files using the .RData extension. We can save individual or multiple objects into a single file.

This makes file management easier especially if you are conducting your analysis in several steps, have collaborators that need data, or just like to keep your data organized!
    • Related Articles

    • Do I have to download Rstudio to code in R?

      Answered in Getting Started with R and Rstudio course at: https://learnadv.com/courses/getting-started-with-r-and-rstudio/lessons/section-0-introduction-to-r-2/topics/0-1-1-what-is-r-and-rstudio/ Technically speaking, you can run just the R ...
    • What is a working directory in R?

      Answered in Getting Started with R and RStudio: https://learnadv.com/courses/getting-started-with-r-and-rstudio/ The working directory is a folder on your computer that R has access to. This folder is where R loads in data, export results, and in ...
    • Where can I download R? Where can I download Rstudio?

      Excerpt from the Getting Started with R and Rstudio free-course found here: https://learnadv.com/courses/getting-started-with-r-and-rstudio/lessons/section-0-introduction-to-r-2/topics/0-1-1-what-is-r-and-rstudio/ Installing R To install R you will ...
    • How do I set the working directory in R?

      Answered in Getting Started with R and RStudio: https://learnadv.com/courses/getting-started-with-r-and-rstudio/ To set the working directory, you'll need the file path. I’ve included a few resources the detail how to find the path for various ...
    • What do the 4 default panes of Rstudio?

      Answered in getting started with R and Rstudio Course: https://learnadv.com/courses/getting-started-with-r-and-rstudio/lessons/section-0-introduction-to-r-2/topics/0-1-2-the-layout-of-rstudio/ How do you use RStudio? What are the 4 default Panes of ...