-
Notifications
You must be signed in to change notification settings - Fork 26
/
analysis_start.qmd
29 lines (17 loc) · 1.06 KB
/
analysis_start.qmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
---
title: "Starting our analysis project"
format: html
---
The purpose of this tutorial is to teach you version control. In order to do this, however, we'll need to make up a simple project that needs controlling!
Our initial project will be extremely simple -- a very small data file and a script that loads and plots it. Later, we'll add code to fit a nonlinear curve to it.
Download this data to your project folder: [Example data](https://raw.githubusercontent.com/RSE-Sheffield/Code_cafe/master/example_data.csv) (right click to open in a new window and use your Web browser's save as functionality (likely another right click on the page)). You may need to manually add the file extension ".csv").
Create a new R script in RStudio. **File** -> **New File** -> **R script**
Enter the following commands into your new R script
```r
mydata = read.csv("example_data.csv")
plot(mydata$xdata,mydata$ydata)
```
Save the R script as `myscript.R`. When you run it, it should load and plot the data.
Your directory should now contain 4 files:
![](./assets/file_list.png)
***