Module 1: Intro to R and RStudio

In this module, you will learn how to write your own basic R code. First, you will need to install R and RStudio on your computer. Make sure that you go through the material provided in the links before attempting the exercises. You have two solutions to attempt the exercise (1) Write directly into the console and click `run code`. You will be told whether your get the correct answer. If stuck, you can ask for a hint or show the solution. Note that the first time you do this, a cloud server will be set up and it may take some time. Also do not navigate away from the code block (e.g., by opening another exercise) as this will stop the execution. (2) Attempt this on your local machine and use the Show solution tab to verify that you did the exercise correctly. You can also use the hints to help you if you choose to run locally.

1R and RStudio

2Opening Rstudio

3The R console

4R classes

5value assignment

6an R project

7R functions

8R functions (cont)

9Comment your code

10Onward!

About this course

This is a free, open source course on how to use different Data Science Techniques and Tools to make your science FAIR. It is made possible by a grant from the National Science Foundation RISE2324732. Contributions and comments on how to improve the course are welcome! To file an issue go to: https://github.com/LinkedEarth/LeapFROGS/issues

About EarthCube

The sharing of open source data, code, and workflows is fundamental to the building of a FAIR (Findable, Accessible, Interoperable, and Reusable) research ecosystem. Open source tools allow for a community to come together and contribute to the development and improvement of research infrastructure. Such collaborations lead to more robust and efficient solutions, as well as increased transparency and accessibility.The geoscience community is only now beginning to harness the power of the open source model, and formal training on the benefits and proper use of this model is still missing from most geoscience curricula. While computer science courses may provide some level of training, the technical details often do not align with the specific needs of geoscientists. Our objective is to build human infrastructure to promote reproducible and transparent geoscience by educating geoscientists on the effective utilization of open source resources through practical applications in their own scientific research.