 Welcome to Dealing with Materials Data, Collection Analysis and Interpretation, I am Guru Rajan and we are doing module on R programming language and so this is a introductory session, this is an introduction to R and in this session we are going to look at demos and how to get help when you are working with R, that is the aim of this session to let you know how to get help and how to look at some of the demos. So in R terminal using help command, how to use help command to get information is the first thing we are going to do. I will also show how to invoke help in R studio, I told you about R studio but we have not used R studio yet so we will use and we will use some of the demos to understand the capabilities of R. Specifically what we are going to do is to invoke R and the help is available all the time in the R console or if you are on R studio and help that start is a good starting point if you do not know anything that is the best place to start the help and the demo is another good place to explore. Demo basically gives you some idea of the capabilities of R, so graphics, image, plot math, colors and NLM are some of the demos that we are going to look at in this. So like I said I have some notes prepared, let us do that and this is the notes. So let us invoke R, last time I showed how to invoke R from the terminal, it is also possible that if you have this shortcut and then you just click on this you get the R console and like I said R version is 3.6.1, action of the toes is what we are using. So let us say help that we want to get, so help that start is a good starting point and it will open a browser and in the browser it will give you all the information. So as you can see this is very, very detailed help, there is an introduction to R, this is what I mentioned in the manuals, this is the material that we want to I want you to explore and this is the kind of material that we are going to cover and there are also other information like how to write R extensions, so if you are a developer or the language definition and installation and administration, so this is where I recommended that you use spoken tutorials for example, but it is possible to get that help from the R documentation itself and what are the, how does R work, so this is about the internals and how to get data into R and get data out of R. So there are other references, what are the packages and search engine keywords and about license and news and resources and lots of other material, user manuals is another thing that I mentioned and if you go to user manuals for example, you will get lots of information, so what are the manuals in package survival, so what are the manuals, manuals in package R part, what are the, so there is plenty of information that you can get by using this command help.start. You can also get specific help like I show here, for example, if you know, let us say that I want to know what is the sign function, so I say help sign and then I get information, so these are trigonometric functions, these functions give the obvious trigonometric functions because it is sine cosine etc and they respectively compute the cosine, sine, tangent, arc cosine, arc sine, arc tangent and the two argument arc tangent. So you have this cos pi x, sine pi x, tan pi x etc compute cos pi into x, sine pi into x, tan pi into x, so this is another information that is given. So it is cos sine tan, a cos a sine a tan, a tan 2 and cos pi, sine pi tan pi. So these are numeric or complex vectors, so the arguments that it takes, for example, there is a y here, that is why y is given and so they are numeric or complex vectors, so you can calculate sine for a bunch of values and there is more information and the most important information, for example, angles are in radiance not degrees for the standard versions. So which means if you want to calculate any of these trigonometric functions, then you have to change the angle value if it is given in degrees into radiance. So information like this, what is the input, in what unit it is there, what is the command and the help file is also very useful because you will see lots of other information. And there is also the reference and what I like the best, the examples. So you will be able to directly take these examples and run them. So you can copy and you can paste them here you can, let us copy. So the up key command actually gets you the information that you got in the previous command and let me try to copy this commands. So you can just use this and so it is a very easy and fast way of getting used to some of these commands. So what next? Suppose I want to know how to get the access information. So you say access. Now there is no documentation for access. So maybe you have a plot, you want to know how the access, why, etc. are and you thought that there is something like access like there was sign and then it is very helpful. So it says try access. When you do, so it actually basically looks for all help files and concept or title matching access it actually gets. Now if you want to know more about this for example, let us say ggplot2 render access is what I want to know more about let us copy this and then you put this question mark and paste that and then you get information on that. So this is another way of getting information from R. You can try to look up some keyword and if the keyword is not a specific keyword, like we did first time sign was a specific keyword but access is not appearing but it will still look up the help files and find information wherever this keyword appears and will give that information to you and from that you can choose what you want to explore. So this is the other way that you can use help. So that is what we have done. So now let us say demo and then it gives you all possible demos that are available. Let us say that I want to try this demo which was called Hershey. So it says return to start. So it opens graphic device enter and then I can go see what it is. Let me move it here and I can keep entering and I will keep getting all this information. So this is just to show you the capabilities of R. So I mean it is not really something that we are going to use but so as you can see things keep changing. So now it has come out. So we have come back to the R prompt. As you could see when I am executing commands on the console, I have to keep going to these figures or images and sometimes they are not even seen. I have to locate them first and see. Now that is where the integrated development environment comes very handy and this is the IDE. Now it actually consists of four pens. So let me do this. Let us say that I want to write a new R script or something. So there is this editor which you can use to write the R script and here is the console because this is exactly like the R console that we got R version 3.6.1 action of the toes etc and you see the help files are shown here. Help files and if you make some plots, plots will be shown here and the packages will be shown here and this is information about the history and the environment and things like that. So the R studio pan has consists of four pens and the editor, the console and you can even get a terminal here for example and then you have all this help files and the environment information. Let us use the demo here and so there you will see that let us say that the demo that I want to get. So I mentioned some four or five demos. So demo graphics is what first we want to do. Let us do demo graphics. Now you can see that, see the plot shows here. So I can keep skipping through. So this is a sample color wheel and see the sales as a pie chart and the notched box plots and the time versus distance in a Brownian motion and so how R has been becoming popular. So lots of information. So this is some normal random variable. So it is a distribution box, the histogram plot and so there is some data which can be plotted. These data are already built into R. So these are used as example data for learning and we might occasionally use but most of the times we will make our own data because we want materials data and use them. And so you can of course get nice color plots and you can get these kind of contour plots and you can give the information in many different ways. So it has come to the prompt. So we have completed this demo. In a similar fashion you can have several demos and actually this is one of the biggest files in the node so far 56 pages because it gives you all that we have seen through now and this is what we have run through up to this. So that is the next demo. So these I think are from demo colors. This is the image. So graphics and then demo image. Sorry, let me go to the RStudio. So this is the demo image and we start and then we start seeing this. So that is what you saw in the tutorial and demo I think colors. So this is the colors demo and it shows you all possible color schemes that you can get and all possible colors that you can get. So these are the demos that are available. I want you to explore. I have given a few more demos here in the documentation just for you to explore. So this is a demo called NLM. So let us do this. So this is the NLM demo. So and the R has come out of this. So either in the R console that is here or in the RStudio you can use both help and demos. For example, if you ask for help here and so as you can see RStudio also has this advantage. For example, do you want to have help on tan or tan hyperbolic or tan pi? So you can get these information. For example, let us say I want help for tan, tan hyperbolic. So it gives you hyperbolic function. So cos sin h, tan h, a cos h, a sin h, a tan h, etc. And again x is a numeric or complex vector and there are these other information and so it is very helpful sometimes to use RStudio because everything is in the same screen and you can switch between one or the other and for example you can even write a small script for example here and then run the script here and look at the result here in the plot and keep track of the information, the history, etc. here on this pane. So this way using the help and demo is very useful and it gives you a feel and it also familiarizes you with the R console and RStudio. So I strongly recommend that you explore all the demos that are available. That will also tell you about your installation, if it is complete and if you are able to see all the things that you should see. So it is a good exercise to begin with. Thank you.