Presentation describing the script in R
Ashu Guru
Author
03/13/2019
Added
189
Plays
Description
Presentation describing the script in R , by Ashu Guru, Univ of Nebraska Raikes School (18 mins)
Searchable Transcript
Toggle between list and paragraph view.
- [00:00:00.800]We will now start working with the R script for calculating the coefficient of
- [00:00:05.055]correlation for the data in the problem set.
- [00:00:09.200]We are working with the water index for this problem.
- [00:00:13.440]The water index refers to a ratio of the measures of wavelengths 900 and 970.
- [00:00:20.840]Accordingly, I have defined 2 variables, wavelength numerator and wavelength
- [00:00:27.205]denominator, which hold the values 900 and 970 so I
- [00:00:31.504]can refer those in my program later.
- [00:00:36.000]It is an easy way for me to refer to a variable rather than referring to numbers
- [00:00:41.625]spread out across the script.
- [00:00:43.640]So in case there's a change that I need to make,
- [00:00:46.355]I can easily make it at one place.
- [00:00:50.000]Here is my first instruction and the second instruction defining the two
- [00:00:53.729]variables.
- [00:00:55.800]In the next few instructions I will change the directory of R to the folder
- [00:01:01.228]or the directory where I have kept the data file.
- [00:01:04.800]So I have two data files, but the first one I will load is the data
- [00:01:09.239]that is collected from the instrument.
- [00:01:12.920]Here is a quick look at that and it has a total of 31 rows with row #1 being the
- [00:01:19.130]description of the columns.
- [00:01:23.040]So let's change the directory or set the working directory to the folder and I
- [00:01:27.643]have highlighted the folder where I am working.
- [00:01:30.760]You will have to modify this according to the folder structure or the directory
- [00:01:34.893]structure that you have on your machine.
- [00:01:37.520]For Windows users, Please remember to change the direction
- [00:01:41.307]of the path delimiter.
- [00:01:44.960]So I'm going to run this instruction now.
- [00:01:47.240]So I have changed my working directory to the directory with the files.
- [00:01:52.920]Now let's load the instrument data.
- [00:01:55.200]I am using the read table instruction.
- [00:01:58.800]So the variable TAB DATA instrument now has the values of the table read from
- [00:02:08.018]this file.
- [00:02:12.040]To get an indication that the file has been read correctly,
- [00:02:16.638]I will print the number of rows that are in this variable.
- [00:02:21.840]So I'm going to run this command now and it shows that I have 30 rows in this
- [00:02:29.268]table.
- [00:02:32.480]Next I will print the column names and the column names are Lambda R plot IDC X1,
- [00:02:41.315]X22, X23, X44, X45, X66, X67 and if we notice that R did not
- [00:02:47.887]change the first column name but it added an X in front of other column names.
- [00:02:56.400]So the reason is that R defines the column names by default with the alpha
- [00:03:01.376]character.
- [00:03:04.560]Now I am going to print the Lambda R plot IDC column as a vector just to look at
- [00:03:12.264]the values that we have and I see these are the numbers that are maintained in
- [00:03:19.778]that column.
- [00:03:22.160]Moving on, if we look at our computational.
The screen size you are trying to search captions on is too small!
You can always jump over to MediaHub and check it out there.
Log in to post comments
Embed
Copy the following code into your page
HTML
<div style="padding-top: 56.25%; overflow: hidden; position:relative; -webkit-box-flex: 1; flex-grow: 1;"> <iframe style="bottom: 0; left: 0; position: absolute; right: 0; top: 0; border: 0; height: 100%; width: 100%;" src="https://mediahub.unl.edu/media/10784?format=iframe&autoplay=0" title="Video Player: Presentation describing the script in R" allowfullscreen ></iframe> </div>
Comments
0 Comments