﻿1
00:00:01,570 --> 00:00:03,950
‫So let us look at some basic things first.

2
00:00:05,740 --> 00:00:09,810
‫In this clip window if you read again two plus a

3
00:00:12,620 --> 00:00:20,780
‫and you run it so to run a query you have to press control plus enter on a Windows machine or command

4
00:00:20,820 --> 00:00:24,680
‫plus a return on a Mac machine.

5
00:00:24,720 --> 00:00:32,430
‫You can see that command that we wrote in the script window is replicated in the control window and

6
00:00:32,430 --> 00:00:40,480
‫it is run and we get the result seven seven is shown in the control window only.

7
00:00:40,920 --> 00:00:45,740
‫Many times we want to enter comment when we are writing the script.

8
00:00:45,780 --> 00:00:52,730
‫So if you have done some programming in C C++ Java you probably would know about command to write comment

9
00:00:52,740 --> 00:00:53,400
‫and are.

10
00:00:53,670 --> 00:01:01,310
‫We use a hashtag or a pound symbol to put hash tag and write anything in front of it.

11
00:01:06,580 --> 00:01:12,600
‫When you select both these lines and render only the first line will give your output.

12
00:01:12,650 --> 00:01:18,920
‫Second line will not give you any output because that a command for those who are not from programming

13
00:01:18,920 --> 00:01:21,700
‫background or who are not familiar with comment.

14
00:01:21,770 --> 00:01:28,400
‫Comments are basically used to add information in your code so whenever someone else looks at that code

15
00:01:29,180 --> 00:01:36,560
‫knows about what you have written in that piece of code that part of the code which is commented will

16
00:01:36,560 --> 00:01:37,640
‫not be done.

17
00:01:37,700 --> 00:01:44,940
‫That is when you run your whole code that will not have any impact on the output because it will not

18
00:01:44,940 --> 00:01:47,760
‫be executed even in art.

19
00:01:48,060 --> 00:01:54,270
‫While doing analysis if you want to share your analysis with someone else it is advisable that you put

20
00:01:54,540 --> 00:01:59,340
‫comment before you start every different part of code.

21
00:01:59,670 --> 00:02:07,320
‫You can see the format and differences in which you are writing in the script window and it is displayed

22
00:02:07,320 --> 00:02:08,250
‫in the console window.

23
00:02:09,530 --> 00:02:16,990
‫You can change this font and the theme of these windows you can go to Tools and select Global Options.

24
00:02:19,280 --> 00:02:28,040
‫In this window go to appearance and select the font size and default that you would like to use.

25
00:02:28,040 --> 00:02:33,630
‫You can also select a team too.

26
00:02:33,740 --> 00:02:39,210
‫All these are options available said it as you like it to be then click on okay.

27
00:02:43,830 --> 00:02:51,410
‫You can also give output in the console or textual output just like we used to do in programming language

28
00:02:51,840 --> 00:02:56,780
‫using print command a print within bracket.

29
00:02:58,810 --> 00:03:05,170
‫And double quotation marks whatever message you write will come out as output.

30
00:03:13,420 --> 00:03:17,430
‫Remember this shortcut to run a command is control enter.

31
00:03:17,920 --> 00:03:22,590
‫Once you are done with your analysis you have to clear the console.

32
00:03:22,600 --> 00:03:31,930
‫The variables that do have the shortcut for that as you press control plus l this will clear the console.

33
00:03:32,080 --> 00:03:36,100
‫So you can see once you play control plus all the console is cleared out.

34
00:03:38,280 --> 00:03:45,870
‫Let us learn how to create variables and assign values in those variables to create a variable.

35
00:03:45,970 --> 00:03:49,660
‫We'll be using assignment operator so we'll write X

36
00:03:53,470 --> 00:04:03,030
‫and this is the assignment operator Lisbon sign and a hyphen or dash and this is that as x gets set

37
00:04:03,030 --> 00:04:06,760
‫to and you run it.

38
00:04:06,760 --> 00:04:13,400
‫So in the control window you can see this commander's run on the data inside.

39
00:04:13,440 --> 00:04:18,150
‫You can see a variable called X is created and it has value too.

40
00:04:19,040 --> 00:04:20,970
‫So this is the use of this window.

41
00:04:21,030 --> 00:04:28,320
‫It will show all the variables all the data that you are using in your workspace to change the value

42
00:04:28,320 --> 00:04:29,110
‫in this variable.

43
00:04:29,130 --> 00:04:31,950
‫You can again write X gets three

44
00:04:36,190 --> 00:04:40,610
‫you can see on the right the value in X a change to three.

45
00:04:40,800 --> 00:04:45,610
‫You can also use is equal to sign but that is not common practice.

46
00:04:45,720 --> 00:04:51,120
‫Whenever you are writing an R if you use is equal to sign it is frowned upon.

47
00:04:51,120 --> 00:04:58,500
‫So it is advisable that you use the assignment operator which is less than sane and then a hyphen to

48
00:04:58,500 --> 00:05:00,900
‫bring this variable in the console.

49
00:05:00,900 --> 00:05:04,330
‫You can just write the name of this variable.

50
00:05:04,770 --> 00:05:15,140
‫You can see the value stored in X is the return by the system if you want to enter multiple values within

51
00:05:15,140 --> 00:05:16,550
‫a single variable.

52
00:05:17,760 --> 00:05:24,660
‫That is if your variable is an array of numbers to do the relate y get

53
00:05:27,330 --> 00:05:37,150
‫here we'll be using the concatenation operator which is C C and within bracket we can edit as many values

54
00:05:37,210 --> 00:05:38,820
‫separated by commas.

55
00:05:38,890 --> 00:05:40,540
‫So one two three four five.

56
00:05:43,010 --> 00:05:47,570
‫We done this Come on you can see why variable is also created.

57
00:05:47,840 --> 00:05:52,430
‫It is an area of numbers containing values from 1 to 5.

58
00:05:53,750 --> 00:06:04,170
‫Instead of using this concatenation operator denoted by C if you have see the numbers only do see creation

59
00:06:04,240 --> 00:06:06,790
‫there is another method why get

60
00:06:10,160 --> 00:06:11,220
‫one to 10.

61
00:06:11,240 --> 00:06:17,410
‫So 1 you write colon and then 10 if you run this command.

62
00:06:17,510 --> 00:06:21,720
‫Norway has 10 values from 1 to 10.

63
00:06:21,800 --> 00:06:25,250
‫2 to do C creation you can use 1 to 10

64
00:06:28,250 --> 00:06:29,920
‫within a single command line.

65
00:06:30,050 --> 00:06:37,040
‫You can do multiple assignments also if you want to assign same value to accent way you can write X

66
00:06:37,310 --> 00:06:38,110
‫gets y

67
00:06:41,570 --> 00:06:45,620
‫and way get 1 2 in

68
00:06:49,180 --> 00:06:53,820
‫so both of these will get the same values in any single command line.

69
00:06:53,930 --> 00:07:01,160
‫If you are familiar with metrics mathematics or vector mathematics these two are areas of same land

70
00:07:02,940 --> 00:07:05,660
‫if you want to find out the sum of these two arrays.

71
00:07:05,730 --> 00:07:12,960
‫That is the first element of X added to first element of Y then take an element of X added to second

72
00:07:12,960 --> 00:07:13,770
‫element of Y.

73
00:07:14,040 --> 00:07:22,320
‫And third with third and so on till the last element you can simply do this by writing x plus way and

74
00:07:22,320 --> 00:07:24,030
‫you've run this command.

75
00:07:24,060 --> 00:07:30,450
‫You get the output with just two four six eight goes up to 20.

76
00:07:30,480 --> 00:07:36,720
‫This is each element of each variable added to same element in the other variable.

77
00:07:36,720 --> 00:07:47,140
‫You could have directly assigned this value to a different variable or two so Z get expressway.

78
00:07:47,450 --> 00:07:53,150
‫So now there's a new variable called Z which has these 10 values.

79
00:07:53,150 --> 00:07:54,820
‫This was element y's addition.

80
00:07:54,830 --> 00:07:59,450
‫You can do element ways multiplication also to do that related to get

81
00:08:04,410 --> 00:08:10,430
‫X multiplied by way multiplication symbol is hysterics.

82
00:08:11,460 --> 00:08:17,680
‫When you read this you can see that 2 is having the multiplied values of x and y.

83
00:08:18,030 --> 00:08:27,630
‫So the third element in the 2 is 3 in 2 3 The last element is 10 including one important thing to note

84
00:08:27,840 --> 00:08:30,040
‫is odd is case sensitive.

85
00:08:30,360 --> 00:08:38,580
‫When are small X's having value of 2 we can have capital X which can have a separate value.

86
00:08:38,580 --> 00:08:41,550
‫So both these will be stored as different variables.

87
00:08:41,580 --> 00:08:44,690
‫Small X and capital X will be two different variables.

88
00:08:44,940 --> 00:08:45,880
‫This case sensitive.

89
00:08:45,900 --> 00:08:47,700
‫It is important to remember this.

90
00:08:47,790 --> 00:09:00,720
‫You can store capital X as capital X Games then run it so you can see there are two variables one is

91
00:09:00,840 --> 00:09:10,310
‫small legs one is capital X there is one function which will list all the values of your workspace.

92
00:09:10,420 --> 00:09:20,060
‫So we have smaller X capital X Y Z and the two all these are the values in our workspace.

93
00:09:20,080 --> 00:09:27,880
‫If you want a list of all these values we'll just write a list open and close the bracket and run it

94
00:09:29,680 --> 00:09:30,510
‫in the output.

95
00:09:30,520 --> 00:09:32,670
‫You can see this is the.

96
00:09:32,680 --> 00:09:37,880
‫These are all the values in the workspace.

97
00:09:38,100 --> 00:09:46,660
‫Now let us start cleaning up our windows again to clear the console will just press control L or click

98
00:09:46,810 --> 00:09:55,250
‫on this broom button on the top right corner of control going to next to delete one variable from the

99
00:09:55,250 --> 00:10:04,210
‫workspace will rate item and within brackets will write x 2.

100
00:10:04,240 --> 00:10:08,350
‫This will delete the capital X from the workspace.

101
00:10:08,360 --> 00:10:10,790
‫You can see that is gone.

102
00:10:10,790 --> 00:10:14,510
‫You can also write the word remove and then write the to

103
00:10:18,630 --> 00:10:20,160
‫this will remove the two.

104
00:10:20,580 --> 00:10:22,260
‫Both of these are doing the same thing.

105
00:10:24,630 --> 00:10:32,610
‫To clear all the variables in the workspace we will write Autumn and in the bracket we will use this

106
00:10:33,050 --> 00:10:33,750
‫Alice function.

107
00:10:33,750 --> 00:10:34,350
‫So we'll write.

108
00:10:34,350 --> 00:10:39,380
‫List is equal to Alice.

109
00:10:39,380 --> 00:10:41,470
‫Open Closed bracket.

110
00:10:41,680 --> 00:10:42,430
‫Run this command.

111
00:10:42,680 --> 00:10:45,470
‫And this will delete all the variables from a workspace.

