‫So let us look at some basic things first.
‫In this clip window if you read again two plus a
‫and you run it so to run a query you have to press control plus enter on a Windows machine or command
‫plus a return on a Mac machine.
‫You can see that command that we wrote in the script window is replicated in the control window and
‫it is run and we get the result seven seven is shown in the control window only.
‫Many times we want to enter comment when we are writing the script.
‫So if you have done some programming in C C++ Java you probably would know about command to write comment
‫and are.
‫We use a hashtag or a pound symbol to put hash tag and write anything in front of it.
‫When you select both these lines and render only the first line will give your output.
‫Second line will not give you any output because that a command for those who are not from programming
‫background or who are not familiar with comment.
‫Comments are basically used to add information in your code so whenever someone else looks at that code
‫knows about what you have written in that piece of code that part of the code which is commented will
‫not be done.
‫That is when you run your whole code that will not have any impact on the output because it will not
‫be executed even in art.
‫While doing analysis if you want to share your analysis with someone else it is advisable that you put
‫comment before you start every different part of code.
‫You can see the format and differences in which you are writing in the script window and it is displayed
‫in the console window.
‫You can change this font and the theme of these windows you can go to Tools and select Global Options.
‫In this window go to appearance and select the font size and default that you would like to use.
‫You can also select a team too.
‫All these are options available said it as you like it to be then click on okay.
‫You can also give output in the console or textual output just like we used to do in programming language
‫using print command a print within bracket.
‫And double quotation marks whatever message you write will come out as output.
‫Remember this shortcut to run a command is control enter.
‫Once you are done with your analysis you have to clear the console.
‫The variables that do have the shortcut for that as you press control plus l this will clear the console.
‫So you can see once you play control plus all the console is cleared out.
‫Let us learn how to create variables and assign values in those variables to create a variable.
‫We'll be using assignment operator so we'll write X
‫and this is the assignment operator Lisbon sign and a hyphen or dash and this is that as x gets set
‫to and you run it.
‫So in the control window you can see this commander's run on the data inside.
‫You can see a variable called X is created and it has value too.
‫So this is the use of this window.
‫It will show all the variables all the data that you are using in your workspace to change the value
‫in this variable.
‫You can again write X gets three
‫you can see on the right the value in X a change to three.
‫You can also use is equal to sign but that is not common practice.
‫Whenever you are writing an R if you use is equal to sign it is frowned upon.
‫So it is advisable that you use the assignment operator which is less than sane and then a hyphen to
‫bring this variable in the console.
‫You can just write the name of this variable.
‫You can see the value stored in X is the return by the system if you want to enter multiple values within
‫a single variable.
‫That is if your variable is an array of numbers to do the relate y get
‫here we'll be using the concatenation operator which is C C and within bracket we can edit as many values
‫separated by commas.
‫So one two three four five.
‫We done this Come on you can see why variable is also created.
‫It is an area of numbers containing values from 1 to 5.
‫Instead of using this concatenation operator denoted by C if you have see the numbers only do see creation
‫there is another method why get
‫one to 10.
‫So 1 you write colon and then 10 if you run this command.
‫Norway has 10 values from 1 to 10.
‫2 to do C creation you can use 1 to 10
‫within a single command line.
‫You can do multiple assignments also if you want to assign same value to accent way you can write X
‫gets y
‫and way get 1 2 in
‫so both of these will get the same values in any single command line.
‫If you are familiar with metrics mathematics or vector mathematics these two are areas of same land
‫if you want to find out the sum of these two arrays.
‫That is the first element of X added to first element of Y then take an element of X added to second
‫element of Y.
‫And third with third and so on till the last element you can simply do this by writing x plus way and
‫you've run this command.
‫You get the output with just two four six eight goes up to 20.
‫This is each element of each variable added to same element in the other variable.
‫You could have directly assigned this value to a different variable or two so Z get expressway.
‫So now there's a new variable called Z which has these 10 values.
‫This was element y's addition.
‫You can do element ways multiplication also to do that related to get
‫X multiplied by way multiplication symbol is hysterics.
‫When you read this you can see that 2 is having the multiplied values of x and y.
‫So the third element in the 2 is 3 in 2 3 The last element is 10 including one important thing to note
‫is odd is case sensitive.
‫When are small X's having value of 2 we can have capital X which can have a separate value.
‫So both these will be stored as different variables.
‫Small X and capital X will be two different variables.
‫This case sensitive.
‫It is important to remember this.
‫You can store capital X as capital X Games then run it so you can see there are two variables one is
‫small legs one is capital X there is one function which will list all the values of your workspace.
‫So we have smaller X capital X Y Z and the two all these are the values in our workspace.
‫If you want a list of all these values we'll just write a list open and close the bracket and run it
‫in the output.
‫You can see this is the.
‫These are all the values in the workspace.
‫Now let us start cleaning up our windows again to clear the console will just press control L or click
‫on this broom button on the top right corner of control going to next to delete one variable from the
‫workspace will rate item and within brackets will write x 2.
‫This will delete the capital X from the workspace.
‫You can see that is gone.
‫You can also write the word remove and then write the to
‫this will remove the two.
‫Both of these are doing the same thing.
‫To clear all the variables in the workspace we will write Autumn and in the bracket we will use this
‫Alice function.
‫So we'll write.
‫List is equal to Alice.
‫Open Closed bracket.
‫Run this command.
‫And this will delete all the variables from a workspace.