 Welcome to dealing with materials data, in this course we are going to look at how to collect, analyze and interpret materials data and this is the first module, this is the module for introduction to the R programming language and we have been working with R in the past few sessions and we have been looking at how to enter data into R and then work with it, manipulated, plotted and so on and so forth. So, in this session we are going to learn how to import data into R. So, data input can be done into R like we learnt earlier by typing it in the R console, but sometimes that is not the best way to enter data into R and in those cases we can import from other sources. This becomes important because sometimes the data for example might be already in digital form, you might have done an experiment and the data comes and it is stored in the computer in digital form and so you want to take the data and work with it and you do not want to be manually entering all the data and sometimes the data could be very big, so manual entry is time consuming also it is prone to errors. So, the most reliable and easy method to enter data from such sources is the CSV file format. CSV stands for comma separated value and you can take the data which is generated and stored in other formats into CSV using either Excel or using LibreOffice or any other commercial software for example and we will use CSV file import extensively. Again there is an optimization point which is that reading and writing CSV files might be costlier, it might be easier and much more faster to use F read and F write, this again is an optimization point regarding the R programming which we are going to not discuss in this course, but it is better to be aware and if you do anything at much larger scale and you find that the speed of execution becomes a bottleneck for you, I think these are some of the places where you should look and improve your code. So, in these tutorials we are not going to discuss code optimization and efficiency, if possible I will indicate, but we will not do too much of it. So we are going to now consider the elements data and I have saved it as a CSV file and we are going to import and plot using ggplot2, up to this we have done, but what has not been done is that can we save the plot as a PDF file, so that is also something that we are going to learn in this session. So we are going to look at CSV file data and we are going to import it into R and we are going to use ggplot2 to plot it and then we are going to save the data, the plot that we made using ggplot as a PDF file. So that is the exercise and saving plot as a PDF file is rather straightforward, so you have to say that you want to save as a PDF file and you have to tell where and what is the name of the PDF file and then you can give all your plot commands and then after that is complete you switch off this device that PDF you close, so that you can get back to your regular console to look at the plots. So that is what we are going to do in this session, so I am going to start by showing you the elements.csv. So like I said it is CSV files can be opened in Libraphis, so I do not know if the data is very clear, so let us let all inform our text, do not know how to increase the size. So this is how the data looks like, so it is the same data, element, console structure, density, melting point and the elements are listed 5 FCC, 5 BCC and 5 HCP. So this is the data and it is stored as elements.csv. So what we are going to do is to first import data into R and for doing that, so I need to know which directory I am there, so I need to see, so now I am dealing with materials data, so I need to import the data, the way we import is as follows. So I am going to say read into this variable x or elements, read.csv, so that is a command from where, from the data directory and which file elements.csv. So it has read as you can see x is 15 observations of 4 variables. So we now know that we have got the right data, so it is the same element, crystal structure, density, melting point. Now let us do the plotting, here we go. So we invoke the library ggplot2 and we say x is the data and the aesthetics is x is density, y is melting point, color should be according to crystal structure and we change the x limit and y limit and the geometry is point. So you can see several layers I am building, so this is the first one, then the next layer is for the x range, next layer is for the y range, next layer is for the plot points, the geometry of the plotting and then the next layer is for the label and label is again from x data using the element information and this is how the label is put, so this we now are comfortable with. So we have it, the density versus melting point and you can see all the BCC, FCC, HCP etc are colored differently and the points and the writing everything is in the corresponding color, so you can get the plot. Now we want to save this file, so for saving it what do we do, we are going to, so I need to know if there is a directory called figures here, so let me see, there is no directory called figures, so it is better to make a directory called figures here, so now I am going to save, so I am going to say PDF equal to, so figures is the directory where I want to save this figure, so it is elements data, so let us say elements data dot PDF, let us say that is the PDF file, so that is the PDF, we are going to say this is the PDF file we want to generate, now we are going to put this command like we did earlier, so we are going to say, so this is the and then we are going to say start off, so I have to give, so now let us go check if we have made this figure, yes there is this PDF file that is available now and you can open it and you can see that the figure is right, so we can, so you can see density versus melting point and all the data points and differently colored, so everything is nicely now stored as a PDF file, so which you can then use for other purposes, so this is how the saving is done and so this is to import data and to plot data, we will have some more exercises in importing and plotting data in the next session, thank you.