Data Science and analytics with R Programming | Ankit Mistry | Skillshare

Data Science and analytics with R Programming

Ankit Mistry, Big data and machine learning engineer

Play Speed
  • 0.5x
  • 1x (Normal)
  • 1.25x
  • 1.5x
  • 2x
25 Lessons (2h 35m)
    • 1. Introduction

    • 2. Windows installation

    • 3. Ubuntu installation

    • 4. Overview of RStudio

    • 5. Datatype

    • 6. Operation on datatype

    • 7. If else

    • 8. Logical operator

    • 9. For While

    • 10. Programming summary

    • 11. Programming Exercise solution

    • 12. Introduction to functions

    • 13. Custom function

    • 14. Package

    • 15. Scope of variable

    • 16. Introduction to vectors

    • 17. Seq rep

    • 18. Vec diff type

    • 19. Vector names

    • 20. Indexing slicing

    • 21. Comparison oprator

    • 22. Basic vec operation

    • 23. Vec nonvec

    • 24. Vec summary1

    • 25. Vector solution


About This Class

Data Scientist: The Sexiest Job of the 21st Century - By Harvard Business review

The average data scientist today earns $130,000 a year  by  glassdoor.

Want to join me for your journey towards becoming Data Scientist, Machine Learning Engineer.

This is first introductory course to get started with Basic of R, R Data structure, then data analysis, Machine learning implementation

This course will teach you - All Basic R, R required for data analysis process.

  • Basics of R
  • Vectors
  • Functions
  • Packages
  • Matrix
  • DataFrame
  • Many more topics are coming soon.

This course is for beginner and some experienced programmer who want to make career in Data Science and  analytics.

Prequisite :

  • High School mathematics

Enroll in this course and take first step in wonderful world of Data.

See you in field.


Ankit Mistry


1. Introduction: Hi, everyone. Welcome to the course on data science and analytics in our So I am on kid mystery instructor for you in this course, and I have been teaching on only me from last one year on a various topics like designs bite on a party spark. So let's see what we are going to cover in this basic Internet recourse on our. So we'll start with a basic introduction. We'll see how to install this R and R studio on a various platform like Windows went toe. Then we'll start with the basic fundamental over your programming languages. We'll see about functions and a packages and in three fundamental data structures are available in a bite like rectors, prices and a needle free register and take it to the world off. Data Science Analyzing data inside the R, every single section I have been covered a good amount of teary and then that is a one practical exercise for all the questions. In a practical exercise, I will walk through the video solutions and then, for each section, has a quest to check your knowledge Marty O learn about. So this course is not fully complete. There are many more topics. I am planning to head, like apply family off function data visualization, data manipulation in our and then we'll move towards machine as the time progress. I'll keep adding the country inside the course, my ops ITU in this course to create a full flight, our programming course with machine learning and data analysis. So that is what about the country I'm going to cover and launching this course of it. Minimal amount off, contain like programming functions, director, my prices and a data free. So what is the prerequisite? Require went rolling discourse. That is no specific prerequisite. You should a curious enough to know about the are and you should be ready to make your carrier is a data scientist or the journalist hurt the orange that is always 30 days money back guarantee. So that is nothing to lose at your side. So what are you waiting for? And rolling Discourse Study. Start analyzing your detail and enter into world off are and I will see you in class 2. Windows installation: Hi. I would even welcome to the really own our programming language. Now, in this video we'll see how to install the US off Anna Hot studio. So first really installed are is a programming language and next will install our I. D. So, which is nothing but our studio. So let's first download both of them. And then you 10 billion stalled, both of them. One maybe so doing Stander are like Tesco to the Ceron. Our project Just search for this c r a n our project and a very first link will be popped up and it will prompt you to download. The are wasn or you can see. Tara is a programming language for all three major operating system. Like a Kleenex, Mac and Windows. As I'm running on this thing on a big nose, I'm just going to select this with those Hang. Just go to the base and it will prompt you to download this and download our 3.5 point zero for the windows has off. I am recording this video, so just selected part and it will prompt you to down as I have already downloaded on my local machine. I'm not going to download it now somehow, let's say if this download doesn't start, you can just select this any kind off meter. It may happen. Did some of the media as, Ah already down? That's why it's not started downloading. But if you just see like the meter and the median videos closes to your country, it's any of the country you can select of. It is closest to you and it will start downloading it. Okay, so that is all about the are another one is a rash to you suggest a part story in and Google, The very first link will be popular, is a harsh and from the product just select our studio If you'll just go down. Now our story is available in a different tradition. So when is open source citizen under one is a commercial license. Now for this programming cause off. You don't need any kind of commercial license, so don't worry about it. You can just download this open source. Words in off This are for the next stop. And this commercial wasn't is available somewhere around close to $1000 in here. So we are going to use this community addition off this are still you. So just elected. Download our studio for the next time and open source was in. Okay. Hey, it will again give you a lot of different choices, so we're just going to select the very 1st 1 Download now. Now, once you do the download now, it will prompt you for the a lot of different operating system which for which particular plenty system you want toe going. So the process on a windows on a Mac Mazzini that sickly a kind of very much similar. Say, as I am on a Windows machine. I'm just going to say like this. Our studio for the windows. It will run on Idol star 78 or 10. If you're on a Mac machine, you can see like this, particularly if you are on our bento on a feather. Also, you can select a respectively. So I'm just going to select this windows and you think promptly took down as I have already downloaded on my local machine. I'm not going to download it. So let me just open where I have kept. They're known really diversion of this in our studio. Now this our story has been downloaded are 3.5 was an R is a programming language of certain boundary. So Alexis the double click on it and start the installation process on a Mac Massino's. So the process is kind of pretty much similar. So do you want to make this happen? Changes to your the race? Yes, so it's kind of conscious process. So just select language and follow the instruction except terms and agreement where you want toe took you the part and just place next next and selector. Neither are total protection, So video just couple off minutes it will get downloaded. It will get installed on your machine. So just wait for some time and it will be installed. Book So in Star listen has been complete. So just click finish toe exit this second now other has been installed Now will select it's our studio to get it in stolen or local missy Crazy us and followed exit step so it will take a little time toe get in store. Okay, so our studio so has been completely Let me just finish stir in starless and dessert and let's just very favor. There are stories, Nick stole or not. So just so place the windows button and by our studio next door, the select. Okay, so our story is being open. It will take a little time to get it open. Okay, So our story A is being open and were successfully installed in our studio. And art is a programming language are awfully. Software were successful in stolen or local machine. Now, in next video will see really walk through this our studio where we're going toe right court and we're here. What are the different components off this harder studio? What is the console or district? Are minute and highly packages Explorer and all those things will see the next video. 3. Ubuntu installation: Hi, everyone. Welcome to the courts on our programming language. Now, in this video, we'll see how to install this R and R studio on a lean It's miss open doors and so first really installed. This are so by default to be the major d off lien expects operating system are welcome rebuild. But if you don't have other relabel, just weaken just manually. Starting. So first, let's a school to the terminal. Soto, open the terminal ANA, open Toby's machine. Just type controlled Alter Okay, and you can use the epic package manages. So yes, you So that gate install R V's hype on, and it will prompt you for your passport so are easily install on my machine. So that's why it is saying that R B school is already in use person. If it is not installed on your machine, it will down there and in starting. So let's just verify where the artisan stolen. Not so to start the art from the common lane problem. Just type kept it a lot present, and it will prompt you. Come online, you can use like a calculator and let me just come out from here. So at his already in start. It will prompt me for weather. But I want to save my workspace on. I don't want to say this business. So are is a programming language. Has meaning store. Now we next deserve in iTunes. Don't our studio. So let's just go to the browser and voted, okay? And just search for our studio download. The very first link will appear for our studio download. Now, this art is available in are so different was so one is a free wasn't which is open source wasn't and another one is And the price was so for this course we are going to continue with this free and open source is And that is more than sufficient And we're not going toe build any commercial application. Yeah, So this just for the learning purpose. So, like discontinuities and download free was in our studio backstop. Open source license. So once you click it, it will take you to for which particular operating system you want to install it. So for bring those market So is are available and for went Oh, I'm going to select this 64 bit wasn't for my current operating system. It's that maybe in this open existence and I have opened towards and is available close to around 14.4 So I'm going to select this particular now I have already installed on my local machines like media school do the download for you. So are still use a river. So once you definitely it will prompt you. Bitter, who went to download off went to software center and it would prompt you for the past one, maybe to get it installed as this us to these also in stolen my machine. Let's just verify and just goto arch to the reputation and starting. So to start, to start, start men and to start the start menu unit does. But is this Windows button and the state do you And just a few. Okay, so our studio has been started on a left inside, you can see the full fledged concert and on the right inside their number off, different sub windows are available. Like to see any kind of environment radio in Houston connections. What are the files? You can see plots. What other practices are available? You know, this our environment currently currently now our decision so Let me just stay Sleepless. Six Ezola nine. Let's spring. Hello, Hot. Okay, so our story also successfully installed on a my on our machine. So that's all about him to install. This are is a programming language. And our studio for the Islay purpose from the next video of next session onwards will start actually courting inside this our studio which are operating system, will you before either Windows are Lennox base operating system. So that's all about deserve you seemed next video. 4. Overview of RStudio: Hi, everyone. So welcome to the course on our programming language. Now, in this video, we'll just walked Rudar our studio. What are the components available in our studio? So I already open, Decides studio on my machine. So let's just go through how we're going to write the court and how we're going to light the different Ask now. If you see mainly, there are the tree you can see some windows are available inside this our studio. So one is a kind of concert. So let's say you want to write any kind of far so you can just write like this and it will immediately give you the output. If you want toe, let's say right, any kind of our school just in a bottom up corner for a top top left corner, not bottom up. So just elect its particular plus sign and it will prompt you Toe start, Let's say our script okay? And here you can just write all those kind of scream, so let's just all right and simple. Hello and hello. So once you're coarser, are you can say the point that is a particular line. If you want to execute this particular line. Let me just write alone. 123 So if you want to just execute, you can just select this around Burton. It will automatically copied all the scripter. Very your current cost. Aries. It will based it on took console and it will start executing it. Now. If you want toe run this a particular line. Pretend about some command line starts so you can just place control and enter, and it will just copy the whole line. Very your current car studies it will placed it on toe console machine and just execute that particular part in the light inside. If you're seeing the your current working directory will tell if you are, let's say, just plotting some kind off functionality, it will prompt already beautiful visualization calf will be available here. That is a good help is available. Particular tool. Our programming language and what are the current packages are available. If you want to install some package will seem to detail how to install the package and how to activate package along with debt. Actually, on our right up corner, that is all environment variables. So whatever the variables and our data type feel created here. It really of element here and history will tell you that What are the command? Your bill now executed on your concern. So desert to some of the basic components off this our studio. If you want to see if you want to change any kind of teams, you can just see like this to its option in a global option if you're on our map machine or that we know are Lennox Machine. In that case, also, you need to go. But what? He stood its particular place where ups inside coming. So sometimes those options will be in a drop down menu or this file. Sometimes it will under the So just stay like this, not appearance. Okay? And inside the appearance, you can select what kind of team you want toe select. So like to select a couple of fun. So you can see let any often out of this in view of the clips And okay, so, ex mate export. So you're just going toe continue with disco bite. So I just like to Scoble and we're going toe Continue this with this particular piece, so I'm just going to select for a little bit bigger, so I think it's OK for 10 will be okay. You can select the which point you want to live it. So Lucy, the console and all those kind of customization you can do it. You can select the team style suits, classic style, our sky style, her mortgage state. So Alexis a play and you can see immediately hold. The team has been completely changed. You can select her classics, Taylor's so I'm just going to continue with a classic style and here are so cold. So just pay supply hand hook. Okay, so this is the basic idea behind? No, but it's our studio. As we go heading inside the course, we'll explore some more for extracted related. So this our studio, but mainly throughout this whole course. So what? We are going to move. You're just going to write the court on this console directly to execute call the simple, simple function are whenever you want. When we want to write any particular script, we're going to use this plus single to create any kind of NASCAR, and after that, Villagers execute that particular ask fitel public's run button. So that's all about the arch studio. I hope you enjoy listening this video and see you next week 5. Datatype: Hi, everyone. Welcome to the course on our programming. Now, in this video, we'll see. What are the different data types? This our programming language support, like a indigent 100 a bottle or a character. So let's define some very well. So will evil you can define like any. The name of it is starting with any kind off character. So let's define in India, let's say a and for the assignment contrast to any other programming language. This are in case of R V. Needs to write like a angle bracket and hyping. So this is called an assignment operator inside the R programming language. After did we can just write simply like, Let's it well, and let me this place controlling talk to exhibit. Now if you see here in our environment, we have defined when global variable like musical hotel. Well, now let's see what is a data type of this so we can use the function like a type off, and we can just simply pass the really about a. So you can see we're defines the Snowden Tasia, but bite if all it has taken double now define explicitly in Indonesia, we need to go victor. And so let me just different yet. So it's a three digit okay, and let's just ratify what type of function. So now it is contagious. So bees indigent, so defining data we have toe explicitly, right? Like a three year. And to define any kind off double, you can just see you supply the value and assigned a value to the corresponding variable. Now you can take advantage of more than one character. Variable name also. So instead of defining, let's see he and you can define like a rare one. Electricity. Fine. Maryland. Let's define you try. It's a PR no 1,000,000,000 but and you can see where one is now. 2.5. We can very favorite this pipe off function. So where one is governed. So you've seen how to define our double and how to define intake. Let's see on a better character, Leslie trainer. Now could you find any kind of string or a character or a list of character you need to write to stain courts? So let's say I want really find like a X, a simple one character really well, and let me just execute, okay, lets see what is the type of is very so you can see now where toe his kind off character instead of writing just the one single character you can write like excising multiple character. Now you can define. You can see the effect on missile that available as soon as we executed so you can see reactor is now x prize it so heroes, exerciser and type of physics for very to is no character. So we have seen in Asia Double Hannah Street. Let's define our bullion kind of video. Let's define a Bakley. So the final deal video will be about two options we can define like a true where even order false video. So in a sort cut, you can just give them capital t So it will be here like and media sexy. So you can see now where trees If you just ready fight. What is the type of this were three medieval. So where? Please like a logical video, you can define this very tree instead of just you can define Laker the are you eat so it's in a capital. Everything isn't capital. Same way. If you want to define this variable as a false you can just simply you like 1/2 or you can you make false so f a LSE All are in a capital for me. So is around a logical let's see another kind of variable. This are supports, like a complex William. So let's define so you might have seen our study Those kind off very well in your high school mathematics. Let me just different. So one is a real part of this are complex. No Marine under one is imaginary part. So let's just define him first. Real part. So four plus, let's say an imaginary parties lets it go. So four reserve aerial part and who is in imaginary part. And we have done this assignment to the therefore video and this is the Assignment radio. So let's just execute it so you can see Fair to is like a four plus toy. We can very five it high speed. Even so, where for? So you can see where food is now a complex so deserved to some of the basic data types available in our programming language. You have seen in this video how to define a variable how to put the assignment all toe this particular variable tell public bracket angle and a hyper. Now you can define like indigent order, string or you can see character order, double video. You can define any kind of bullion video, POC and how to define a complex web. So deserved the five fundamental and basic data types. This our programming language support what we have. So this is all about how to define a variable. Now, in this next video, we'll see. Have you can do some sort of operation on the top off it. So I did. It would be a logical operation order, any kind of mathematical operations you can perform on top of all this kind off. So that's all about this video. See you into next video. 6. Operation on datatype: Hi, everyone. Welcome to the course on our programming language. Now we have seen in the last video how to define a different kind of variable in this our programming language. Now, in this video, we'll see how water the operation are either mathematical or logical. Objection. You can perform on the top of this week. So we have already defined. Let me just make some space here. So we already defined If you seen a environment global environment variable, that is a e me. Where one where do all those things has been already defined. So electricity do some very simple mathematical operation like a recent order my publication. So let me just define another Really Well, let's see what I saw. You can define like the result and fear Allah earlier video like a and B so we can just simply grab. He blessed me and lectures execute. Now you can see a plus musical defecting so well plus trees of electricity Simply we can define Laker. My So it's in my duplication of this to number. So, Toby, and let me just execute some Miley's equal, you know, practice six well, multiply by 30 disease. So all those kind off simple mathematical operation you can just simply performing. Now let's go with a little bit. Hardly function. So let's see, you want to find a square root of any kind of function, so you use use square root. I like to supply this month and let me just executed. So I'm not going to assign this to any kind of variable so you can see it out. Put on a concert so you can see now the scratch it off. Ismael Variable is equal to six. In this case, if you just define it, has you, so you will get out. Putting it. Some radio has keep so excuse according to six. So this way you can perform all kinds off Mathematical operation under variable What you define now, Apart from that, we have our own little kind of very well, like a spring. Very well. You can see character type of video, so, like meters execute deserve very Gloria. And let's define a new video. Let's see. Hello, So I'm just going to define it later. No friends and Canada Very well. It's me, just me finding Laker. It's a where six of your only taken. Where? 1234 minutes they find Hi, How are you? So I really find it very well. Like this exhibit boat up first. So it's a hello and under one user. Where? Six. Howard. Now let's say you want Oh, do some sort of string concatenation. So you want to module join both of this Valuable. So what will you get it and how have you achieved this string? Concatenation. So for that you can just use the function maker based now How does automatically? This is a game I haven't told you. But whatever the function, you know, just certain some few character off that particular function, Let's see based and just place the tap automatically. All those bobs Welcome Bitter Let's stop Such isn't so BSD We're going to use dysfunction the first time when we're going to supply a Laker Hello! And under that I give me It's a really six and like notice executed So you can see now about what is hell offense. How are you? So this way you can do all kinds of string concatenation or so so in the city of years in how to perform those kind of mathematical operation on the top of what really will really, really define like a simple, intelligent and a double video. But we'll see how to do the some sort of advancement in medical prison. Let's see another one later so you can use like a power and all those kind of meta meager operations are really so we have seen for the restoration purpose this sk rt scrabbled with you and with the help of this string, variable views in how to do the concatenation off. No difference thing there are many more optional operations. You can perform on the top of all those millions and sick and go to the documentation. And as we put this along in this course, you will get to know about one of the more things you can perform on the top of the city. So that's all about the d CDO. I hope you enjoy the sending this video and see you into next video 7. If else: Hi, everyone. Now in this will you will see how right the decision making statement Inside this our programming language so many times the situation occurs that based on the relation of some condition, we need to take one type of action. So let's say if something happened something, they noticed it. Hes do some other t So die there being conducted such a kind off disease and making statement how we contrite inside this any programming language and specifically in this case, in our programming. So in the last video views seen how to evaluate any condition to be a true or false based on some sort of competitors and logic. Elaborate. So let's define one video, so you'll get to know about it. Let's define excessive, Let's say for okay, now we want to find that or we want to do but from connection. If let's say access in greater than for our access less than for vineyard to do something else So we can like, like if and then brackets inside the bracket, we can put all kind off comparison Anna. Logical condition. He Let's say X is greeted in four. Then put the car. Liberace is So this is kind off you can consider if look that if discard dis condition got through, then immediately the control of it goes to here. And whatever the free light inside this particular part off court will be executed. Let's say he fixes not created in. Then we can rightly else simple interest in both the place lettuce print A very simple X is greater. You know, for cimri in a health statement will like later excess list them Lord equals it is not greater than four. That means is it is it is less than or equal before. So what is trying to achieve that? First, it will type toe value this particular condition. Now we have a four accessible so four his covenant for Vetements condition won't be irradiated toe through So control will not go inside this if statement But then that is a one only plot agreements. Mitt is nothing but this else statement. And inside the else statement it will try to really our titles You all to fung all the court what we ever return So let me the scope it is fully core and let's just execute. So I am just placing controlling that so you can see X physical Toby off on. Currently, Vo said. The sexism before technicians access Liston or equal toe so it has compared. This four resulted in for the condition is really toe falls. So it is something like a first instead of this X. Hey, check for 40 skated in fourth, then it found false. Now, if something is false, that means the control will not cohere. And other than that, control will directly jump inside. This helps block and inside Tell spoke it will try to execute three meaning pushing off the court. Let's make let's say X is equal to 10 and lectures re execute this for you and let's see what happens. So now access greater than 40 because we house active sex physical toe then. So this is a very simple FNL statement. Let's say we want to make things little bit complicated. We want to write some sort of if and else or listen, making statement inside another. If so, let's say, Let me just come and get a spike. Let's see, we'll check whether access skated in four or not. We want to check access in greater than seven So if X is good, it in seven. I'm just going toe playing the same thing. I'm just writing access greater than so. Hence exes. Listen, sound, but great event for okay, So electricity movies. So now you can see the core got a little bit complicated. Have you define X is equal to 10 now? First it will checked. Checked whether this particular racks it is equal to 10 is greater than foreigner. So now condition got evaluated duty to and then whatever the core of your return inside this if looks so, this is the full of flock off the first if and inside the four also again, we only turned up. Now when this isn't making statement like again, it has check where if we discredited in for let's check whether it's getting in seven or not infer discussed it and sell it. Let's just print go to themselves else. If it is not good, that in seven we are another condition like access list insert, but via holiday inside for because less than seven minutes it can be anything which is less than seven, but we are already in a condition that it's included in four or so. So it will be between for sale if it is not good in for whole control. Wilco's toe here. So this is like a nasty leaf NL's. So let me just selected and lectures executed. So now it seemed that excess coat that in seven Let us make a small 18 like will make it between 4 to 7 and let us execute. So now, just past the video for the second. And just think about didn't what particular statement are bring? Statements should be kept pretty because 60 skated and four so control should go here And then again it will check succeeded the results of this condition one be related to be true . So in a health statement, it should go so like just so X is listening seven. Because of the whole given this X is equal to six. What good did it for? So that's completely fine. So that is all about how to write the decision. Making statements like this are programming language, a very simple way. Just put the condition along with this if statement and if the condition got through, whatever the court, you were returning right inside this girly places off this block display. Aren't we kept executed? So that's all about this video. See you into next video 8. Logical operator: hi everyone who welcome to the courts on our programming language. Now, in this video we'll see what the operation you can perform. One the top off this logical or ah, logical operator. Logical bullion. Variable. So we have already seen how to define this Logical. Very well. So there are mostly two states are associated with this. Logical, Very well. So by defining you can define it like her group, and you can give us our good name. Later, Durso and another Muneeza Feiss. And you can you later f So here it feeling too. So either you can give, like a our theory, we drew. So all are in upper case. So there are pool states that there now how we can use Dysart variable and based on some sort off any kind off competitors and condition. What it will result is that is ah, William Variable. So let's try to compare some new video. Let's say we want to compare Leg Dan is greater than her three skated in 10 or not. So let us execute with control, enter and we'll see what result weight gives. So it has immediately return us. The falls with indicates that this condition has been irradiated. Toby Falls. Let's do the same thing, Laker. Three years listing. So now it has evaluated Tokyo through that mincer, the tennis credit Antley and this condition is true. That means it has a returner through. We can do another logical order. Companies and operators like, Let's say, three. This is a 10 so definitely return force because three is not equal. Do then we can compare, like five toe fight. So you do like Gartner Group. So the basic idea behind Decter whatever based on some sort off compare is an operator. What condition it will be veloute and evolution output will be either this logical output like true or false. Apart from that, there is another one like five. He's not equivalency fi, so it has returned us off false. We can give, like a fights nautical to six. So that means it has return it through because fires nautical toe six begin. You are other than just simple in danger, like some sort of complex functionality for complex expression like let's if I is a little two plus, yes, so what it will do if it will evaluate this part. It really valued this part and it will do the comparison. So we tested it. Don't know. No, they'll know what we have seen. Doctor. Whatever the line vo executed, it has immediately return us the output on the consular. But there is no global environment. Very well has been created. Now let's say we want to store that Result officer particular expedition so we can just give, like, Let's see this one. So result one by one and it will just do the assignment operator. So now result of unease. Lexi. Let's give it another one. Laker. Let's see. Adi ist. We'll give it another expression. Like five not equal to six. Five is equal six. So it is a fight so less when it's true, raced to his fights. So we use a lot off a comparison operator like that enlisted the apart from that, there are other, like a list dinner equal to or greater than or equal to. He is not equal toe eso is not because it is kind of completely opposite office. So let's say he wanted not operator and then you just devalue toe. So true, become files same way. If you Mr do falls and Negus in off this particular voice. So it will return us to now, apart from this list dinner greater than kind off in negation. Kind of opposite. Other logical operation like ending off Peter are in a position I saw possible. So let's say we want to find investment, Ari. So in case of Harding, we need to write a one pipe over it. And body is store like just devalued. So before the religion, the criteria for orange is if at least one condition is true, it will return a stuff. So we have this arias money is currently true, so it will return us okay simply because it relieves the condition. Like er, let me this copy and ending operation. Okay, Alexis family. So it has taken forced because ending our present condition will tell that if any of them put this falls, the whole output will be definitely fuss. We can apply Same way such a kind of negation opposition also explanation Mark And then let's art he this one. So arias one is currently through and we are negative on it. So that means doubt who should be a voice so you can see the first. So the idea behind this logical up listen to evaluate some sort off conditions based on some kind of mathematical and logical operate. Her logical expression. So intensity of years seen how to evaluate the condition through and a fall saying how after the revolution it will return us through, enforce and based on crew and force. We can take further disease in for some sort of reason, making statement like defense. So post isn't making statement. We have seen toe next video. So that's all about this video. See you into next week, you 9. For While: Hyoty one. In this video, we'll see how to do the looping mechanism in our programming language. So we already seen their decision making So for thirties, in making if some condition got evaluated, Toby true then some particular part off court will be get executed, but that it's executed only once on. And if that condition evaluates Toby Voice, 10 other part of the court will get executed. But let's say if you want to learn some particular portion of the court continuously, some particular number of time, let's say five times 10 times. Or let's say I want toe. That's a pretty I know what you mean. Let's it 10 times. So I just executed. So it just bring the one time again. I need to try to score Let's five times this week, so it would bring it five times. But the five times this particular pull back the sprinter from God executed, and that is a very later nandina course, and discord looks little hug Leo's. So can we cue somehow some instruction toe programming language tech? You execute this particular portion or this particular statement five times, so let's just put it into some kind of block. It's in places. No. How will give instruction that you executed five times? So for that there are two mechanisms are available in a programming language later, right? And a full. So let's start with the right and inside the vile. Okay, we'll put the condition. So for the condition, let's just they find one variable. Let's a counter. So counter. Let's define it for the fight because we want toe Print it for the fighting's and we'll all this check the condition whether sees greater than zero Not. And every time this brings got executive will just agreement seasonal C minus one. So what happens here? First it will take seasonal toe fight. It will enter inside the look if the condition got through. Because now, if I skated and zero so condition is screw, it will print it. And then it will dick cream in this sea. So see, become now for so every time the loop happens sees the cream intake. My what? So at 10 men see becomes zero. The condition got false minute one be printing. So when seasonal ofa it will print one seasonable for it will again print one season below three it will print season will look to again. It will bring seasonal the one also it will cut, printed because one is coincidental. But vincey becomes it'll it won't be printed because zero is greater than zero. This condition got for so as long as inside this on vile off. Along with this way, whatever the condition will light inside this particular bracket which got diluted Toby A true until that time, this whole look will keep running. So if you want to run such a kind of core multiple times, you can use the mechanism like by. So let me to select a full court and let us next year. So now you can see the whole exhibited the full court from seasonal defy toe this a whole violet. It has printed this hello or Jamie continuously fighting. Let's say I want to print 10 times the same. Very simple, really. I can just simply change this particular counter and Lexus Select have you? So hello. Let me has been printed back 10 times. So this is one of the mechanism that is another mechanism like a full look. So before four look, let's say we want to generate some sort off sequences are. So how will you do it gets They want to fight. I want so one Golan fight and like, just exceeded. So it will return me who want to fight all the intelligence. If I have, let's say one pen, it will return me 1 to 10. All right, now how we can use this thing inside this for you. So for same statement, we're going to use. So I load him. But now we want toe print this load, Amy 10 times or five times with help of this fall. And let's just put it inside brackets along with the four. Also, you need to put some sort off finish. So here we have return the condition. Same way here. We like another kind of condition. So in case of I love you already explicitly defined when counter video here we are going toe there. We are not going toe particularly assign any kind off counter, Billy. But we can just simply define it here. Let's say I'll just like eyes, eyes like in a counter video. So I in So what it will do that they see in a violent is as equivalent Toe this line. Follow it. Will goto bill over musica this icicle who want to bend and every single local prison this I will be getting with it. So here you explicitly declare minted or we can inclement it. But in case of this four look this automatically it is incriminating or a document will happen. So now we want to go through this Looked through this one toe pennant Asia. So that means every single loop occurs. And this I will be incriminating. My So let's just select hand. Yeah, so hello. Demi has been printed paintings. So that is what? The basic idea behind how the looping mechanism working our programming language that if you want to execute some sort off wars, some snip it off court multiple large times have you achieve it. So this is a very simple thing. Reveal done as the, uh, progress along the course, we will get toe. See, Doctor, what are the complex kind of cold we are going to write inside this particular block? So that's all about this video, See, next year 10. Programming summary: Hi, everyone. Welcome to the course on our programming. So we have gone through in this section three about the programming fundamentals like the whole learn about the data type what are present. You can perform under top up data. What is the decision making statement and how to used the looping mechanism inside the R programming language? We learn about the different logical operators also. So this is a brief summary off what we have done throughout this whole section off this programming. Phenomenal. So now it's time to check our knowledge. Like what we have learned, throw this whole section so far, checking your knowledge. I have created one exercise and one crease so you can go through the quiz or you can go through the for exercise. You can go through both of them. So in case off exercise have created some of the questions. So let me just select this very well in a little excesses Park and I only stayed here like 10 different exercise problem. So I would highly encourage you to go through each of this question and repaired the solution on yourself. Once the solace in has been papered, I will go over the solution off each any every problem describing this exercise in the next video. And after that there is a quiz also available on our basic very well until today. So that is all about the brief summary up on this, our basic fundamental stuff. You just go through this exercise and I'll see you in tow. It's on your video. 11. Programming Exercise solution: Hi, everyone. Welcome to the solution video of this programming fundamental exercise. So let me to select all the questions and we'll just switch over to the R studio. Okay, so I have copied all the questions and we'll go through the solution off each of them one by one. So if you haven't gone through the solution are your own. Created the solution. I would highly encourage you to pause this video and create solution yourself and compare your solution. So let's start with the very 1st 1 So the first twenties, like air six and nine. So it's so simple, we can just simply select like six class nine. And let me just execute so far, executing this particular line on a Windows machine we're going to use control, enter. And if you're on a Mac machine you can use Come on Blessing. Let's go to the 2nd 1 like a chocolate. Three to the power off. Seven. So to calculate the power off any number in case off our programming language and most of the time in other programming languages, so we use the carrot single on a left Insight will use the base like we want to find a power off three. So three will become here, miss. And Oh, after the correct symbol we need to put the exponents so expanded. Here, in this case, is a seven. It's home. This will calculate three to the power off. Seven. Easy. It is roughly equivalent to the It is a collective 333 multiplied by seven times. So it's a 2100 entities like this, uh, find a power off some familial. Um, let's see, due to the power off six So it's a 64 so that is fine. Let's go down and get one next one. So calculate what is the reminder when you divide 23 by So here, in this case, we need to find the reminder menu Divide 23 by seven. So to find a reminder, in case of this, our programming language, we need to use this person stateside two times and then seven. Okay, so, no, what answered? We can expect here that when 23 will be divided by seven movie, however, 21 that means to should be remind because 21 will be indigenous, developed this seven. So let me just exceed so it's settled. Now let's say we want to find when we divide. What is the intention? Multiple of this seven So we can use simply late Wait seven, so it will be 3.20. So if you want, just ain't azure part off it. We can just use seem percentage percentage and then do it so it will give us Netley. Let's go to the another one. Creativity. Relax and assigned toe 29. So it's so simple. X and we need to use the assignment operator. So this is the assignment operator in case of our program in syntax, and it's just a sign 29. So once you assign extra 20 night automatically, this actually will has been created, and we got this ex ready willing environment. Let's go to the next one. Check with the detail. What is the data? Type off the value. Continue inside the video. Alexe. So what is the data type of the sex? So we can simply use the type of function and we can just pass hex, so it's a double, so we have a double value. Continue inside the medium of X. Let's go to another one to eat available temp and assign a 1,000,000,000 value through to it. So there are two ways we can assign a 1,000,000,000 value like a one. His leg simple T and lettuce so damn has been created, which is airing a value through or you Can you before you true. Like Dru, we in a capital same mode of the equivalent statement and after exhibition would recreate exactly similar results. Let's go to the next one like printer value affects between just simply print tax and exited this part. So access 29. No, they're trying to say this change the value of X two. That's a 34. Okay, so I'm earlier it was a 29. Now I'm going to change it toe 34. Now they want this 30 for Toby in India. It's obviously where I'm just reading. Indeed, you have here has a question. So to create a danger or modified the value because I clearly have found that X, the value of X is like a double, but in this case, we want our extra beer. 34 entities are so intelligent, so to create the intelligent 34 in a variable accelerated to use like a 30 for help. Okay, And now let's whispering tax. So access 34. Now again, We checked the class off the variable. Let's say X. So what is the data type of this? Really? Relax. We can use this. Type off and you can see the difference. Doctor, what is the type of X? So now it's indeed it. So I clear it was a double. Now it's indeed. So that's all about this video seeing this video. 12. Introduction to functions: Hello, everyone. Today we're going to discuss about the function. So in the last couple of section we have already seen about the number of functions, like in a vector section. We learn about the combined function to create directors. We learn about sequence function, and then we learn about grab attention. So it's like for the reputation. So what does the function mean? Let's say you want to wrap it up, some piece off or in tow. Some sort of you can say model. It is also called as a function. Once that particular piece, of course, got compiled. You can call it that particular function from anywhere from your mean program and object to behind this function is put your some piece off or for particular tasks, put it into one particular function and call that particular function from anywhere so we can do the analogy off this function with any kind of mechanical machine. So let's take example off. Let's say bike. So the function of bike is to like go from one place to another place, so you give argument like a sequence of commanding how to try you. The function off the bike is toe drive or walk from one place to another place and output will be. You will reach to the Your destiny is in place. So in that case, the bite will be a function. The input argument you will supply toe the bike is how to try. So like a sequence off steps or sequins off command to go from your source station, destination station and output will be. You will be a great distances station after exhibiting all those couple of steps. So same in our software, voil also dysfunction box. So every single function has their own importance. That own specification. It has, ah, their own input argument and output argument. So you supply something or if you don't supply something, the function will execute and perform its own task, which is defined by the ah body of that particular function, and it will break down output. It may return or it may not written, but it will perform that particular function, which is return inside body. So let's take a deeper look attar this particular sexual function. Let's take a a sequence. Now this art is comprising off huge huge amount of function and every single programming language you might have here that the lots off missions are available to make your life as a developer become very much easy. So let's take the locators little bit deeper. Lucrative one function later. Sequels. So, uh, very good documentation is available for this all the function in a our documentation sites . So if you want to know any kind of documentation for particular function in are you can just use the question mark and I don't function and just executing, so it will prompt you to the function. So what this particular forms and Essick you will do. So it's a sequence, generals and for instance, the objective behind this particular function is to generate the sequence it will give your good, nice overview deck. What is the description behind that particular function? What this particular function? Very good. So it says that the general regular sequence has CQ with the standards in recruiter leave for it. My turn sequence. Not think so. Dysfunction is tryingto generate, mystical and soft number. How will you use that particular sequence of function? So this system be you can generate to sequence a function. What argument? You can her supplies like this So let's ah, generate argument. Let's put posting into argument and let's see what it will generate. So as CQ So that is the sequence is a function me. After that, you need to provide the argument. So the argument is like somewhere around 123 and four. So does it. Are some of the minimum argument you need to supply like a farm? And so lectures supply. It's the home. He's a good one. Do let's see and we're not going to supply any other argument. So let's say Let's me just executed. So it has generated of 1 to 10 number. So all numbers are ranging from starting from one and upto 10 and incriminated by one. So we haven't given this by by anything. So let me just you it's it by Let's it so evaluating, lamented by do so one to create, to fight to seven to. So this means you can properly use the argument off different function. Now they're saying that you can give the another argument like Linda daughters. So let's say instead of giving that how much a particular sequence has been incriminated after everyone inflation. So here it is it increasing my do. Let's say instead of that I just want to run away like lender Doubt. So lend without description. Also, they are given that desire land up sequence so earlier the number increments off the sequence. Now, in this case, desire land off sequence you want toe generate. So I want to generate Let's see 30 numbers between 1 to 10 so automatically based on this from number no number and the landlord out. What we have given it will generate the equally partitions value so equally space where you can see. So in our case, the from musical do one musical lieutenants of 10 minus one become somewhere around nine and the land to be or given thirties attractive minus 1 20 name. So it will do all those kind off calculations. So let's just first perform listing on our concert. So could be hell from then, minus one the right way. Total length of er giving turkey 30 minus one. So, based on the perimeter, very well supplied, like a landlord out from any two, it will calculate this my value. So in that case, we do not need to supply this my will. So now everybody was mean. I in cream incriminating, grilled by Well, got Jeremiah 31. So, Alexis, execute and see whether the sequence injected, which is a space, are equally distance away from each other by this particular values you don't want 31. So now you can see your point tracking. So from one to 1.31 10 1.62. So exactly, Silvio got So that means this by has been calculated based on other parameter. So this you can just go to the documentation off individual functions that available inside this our documentation beach and you can just go through all the argument and based on your requirement, you can just supply to circulate. Now, we hope supplied this argument like this. So instead of just passing, let's see Will pass like 1 to 10 and we won't explicitly tell that it is the from value in a two. So let's see what happens. Okay, So, as in case off this argument sequence or so, the first is a vital fall from and secondly, student and tournament is a buy so beautiful it will take this from Israel. 12 is equal to what do Isabella, you said then. So if you want to let the supply like for me the next place so you don't so you can supply leg from next. And in that case, the order of argument will not meet matter, so lets it go. So if you just explicitly tell while calling this particular function as a part off argument that which particular parameter has a which particular value then order might not important. But if you just do not give any particular key value, that which particular will lose corresponding to which particular parameter object function intact case it logistic, the default or other individuals this supply all those kind of argument. So this way there are hundreds of thousands of functions are available in r You can just go to the documentation, will learn about you can you can just execute and call those function so deserved call function you can Colleges of built in functions are available because the implementation of dysfunction we haven't created this is a part off. Our programming language are some sort off. Any other packages are available, you know. So we heard discuss about the packages See, at a distance about this package in the next video. But there are some other sex off functional so you can get Laker your custom function. So in this video views in how toe call the billeting function available in our programming language in and next video will see my how to write the custom, our friends And so you can create your own function. You get like the body and execute the steps you required to get it executes based on some particular functionality you want to perform. So that is all about functions in our I hope you enjoyed listening disappear in Syria next with you. 13. Custom function: hi, everyone. So let's continue our discussion on a function. So we're already seen in the last video that how to use the building function available in our programming language. Now, in this video, we'll see how to create your own custom function. So let's start with a basic idea and basics in Texas politic toe How to create the function . So first you need to write Laker, make a function, need dinner assignment operator after a full flight function. Kieber. So that is called a keeper, and this is the function in anything you can give it after that. Parentheses Parent is this can accept some sort of our human. So let's say in one in tow country, anything, any number of arguing you can just supply. And then the car. Liberace. When you will light a Julia body off the function, you can call it the court who get it executed. I'm just writing your body of the function, and at the end you will just call this particular function Victor brackets here you can past are giving like listen to hi like true voice. So this is the basic syntax behind creating any off your custom function inside the R. So let's create a simple hello will function. Let's do the name like a print. Hello? Okay. Electrics assigning to the function. Let's not take any argument as a input argument, but this particular person and inside the body will just right brain. Hello. Oh, sorry. Actually, print. Hello. Okay. And like this call dysfunction. Hello And parentis is Okay. So what we have done year, we have created one function which is having a name. Brent. Hello. So this is a four string. Call it as a function. And after that, we tell public pension Cheever with zero argument is input argument to this particular function. Well, just printed this print. Hello. And whenever we call this particular part print, I love Twitter. Parentis is on our backs. We can It will just start executing this particular portion of the court of each other. We old it on inside the function. So in this case, we have just returned this. Hello. So let me the select this portion of the court and let me displace controlling. So now you can see for state has executed this particular function for intel. Also, it said it has compiled it. And when we call this particularly the sprint hello, parentis is it has a start executing the portion of the court vote. We'll return inside. Different Now if you see here the environment part one function has been created, which is nothing but rain. Tello. And that is a type function. Now let's add the complexity little bit. So let's just take some input argument. Let's say name as our input argument and that particular name. We are going to print it so instead of the spring function, will use the rest inside the print. First argument. Let's escape it as a Hello. The second argument really put it like a name. Okay, so what did we do? That instead of just printing Hello. Now, in this case, it will bring hello and whatever the name has input argument well supplied. So displaced function become mine. This hello and a name What we supplies input argument while calling dysfunction Buentello. And it was just sprinting. So Lexus God victim, Let's say so. It should bring hello putting, because now input argument who they mean has been passed to this particular name. Variable and then name has been printed here so hello. Hold Amy. It will combine conch ordinated all listing and whatever the conch ordinated think it will bring it. So let me just again executed. So I'm just ready yet secreting dispatching Look, court because video changed the specification off this particular function and a body off the functional. Let me just execute the new plant. Hello has been created. And now you can see your call this Uday Mia's input arguments. So it has been Invictus low wording. Now let's make things little bit more takia. Let's say instead of just printing, I want toe put those things toe some sort off variable and missed message maybe. And I want to return this particular video. I can just use return function. And inside the return I'll past MST video. Okay, so now, instead, off printing will just take this out, put off this particular colorable function just but in Tello into sound video. Let's see and then out. Okay, so what do we held down here? Italy. We are taking this irimias input argument with this particular solution. We are doing the same pasting, concurred in ating listing, but rather than just sprinting it their own, I'm just taking in the 100 radio like amnesty like a message. And I'm just returning this particular will you whenever and while calling this particular function I am taking this particular video will into all tradable. And then I'm just sprinting. So let me this against select this whole part. Electricity execute. Okay, so you can see the same Hello Limit has painted, but now it has been take for the print Fortis out variable So inside out where they will be Oh, God! This Hello, Jamie. Now every time we can even change like let's say hello are and let me to sex Now only this much part only needs to be execute Because this print I lose me quality Define So it s printed. Hello are now Every time when we put any kind of input argument we need to supply some sort off, will you? So can we do some sort of the Ford value? Can we put some default? Well, So even if you do not pass any value while calling this particular function input argument , it will just take those knee for green. So let's take a default. Lets it named John. So let me the city. Execute this particular version. Okay, so print hello has been defined. Now you can see the specification is completely changed. So name is Hello? That is that the for longer? Earlier it was not actually John now, like me just sprinting. So it has been intake. Hello are only so it has just completely ignored this in default value of this, John. But let's say you don't supply anywhere. You inside this hello function function. So now it has been injected. Hello, John. So even if you don't pass any argument so this particular function by default values joints So it has taken those value is a John. Now let me this remotest John. Okay, let me just reworking over earlier and let me just again called listing. So now you can see it has given us the error. That argument name is missing because if you don't supply any kind off the file name or default value toe this particularly input argument it is expecting Take while calling this particular function, you need to help some sort of input argument. So now it is saying that adding a based a lonely because now it hasn't normal you associate it with this name because we are not supplying anything while calling this particular function. So our human name is missing. We didn't notify. So you are not setting any default value for this input argument name. And the name variable is completely missing So violent, signaling this particular part off the body of the function he not inside the body of the function. You can see Adelina based from Senate, its strengths. So this way you can put the default value. If you don't put dirty for value while calling any particular function, you must help toe sang any value while calling this particular function so well. Now then all those things with the help of just one input argument. Let's deal the toy input argument. That's a name and name. Okay. And let me just make it capitalized. So hello. Name and let's do end named. Okay, so what? It is trying to say that's actually it in ticket to input argument, right? That in just of money put So hello. Name one? Yeah. I'll just put it new money. It's a name one and named. So whatever the new argument well supplied here it will just take it or put it in tow message. And with this certain. So, like Mrs Exhibited spring, I log in. Okay, now let's just surrender. Oh, hopes so. I haven't supplied any arguments, so that's what it is saying. They added, in place. So argument Name one is missing with no different because our women, who is also missing but the vile exhibiting this particular concern the first name one are you many didn't get. So it is just for Internet like name money is missing. Let me This is gonna execute. Let's see John first argument and undertook giving like Ellis. Let's just drink. So hello, John Hannah. At least it has bringing. Now you need to preserves the order because the first argument you have supplied like a john, it has been copied toe this particular valuable name one and another argument. Alice. It has been copied. Name. Now let's say you want to reward starter or you don't want to preserve order and still you want toe maintain tactics. John. One needs to go toe name one and callousness to Goto name because, as you are not telling by calling dysfunction, that name one is equivalent to the Sanjana and named is equivalent to Ellis. He just takes the default order in which you supply all those arguments. So let's say you don't want toe give it like this instead of that you can you The 1st 2nd argument at a first argument by calling to see these two functions Name do, Let's make it John and now name. So if you just apply in this faction in this case, you do not need to preserves the order because you are explicitly telling while calling the function that name two is equal to John. So here, named Will John will be got to name to Ana. Alice will be copied. So let me just execute and see what. So now Hello, Alice and John, because the name one is Ellis and named to his job because the baby are trying to print are based in this particular contaminating particular name, wanting to string with another toasting like a hello named Vernon named. So have you seen a lot of different variation off writing function? Laker, without any argument, ordered some sort of input argument with returning some variable or can see some sort of defaulting argument how you can supply the my people argument if you don't want to preserve , stop order off argument how we can supplied input parameter while calling the function. So there are a lot of variations meals. So that's all about the hope to create the function. And since, like the R programming language and Lauraville, you should hear sing while creating such a kind of function. So that's all about distribute seemed next week. 14. Package: Hyoty one. So in this video, we're going to discuss about what is packages in the heart. So we're already gone through what dysfunction We created our own. Built in function off. We created our own custom function, and we're used. Auto, we have seen how to use the building function available in our programming. So what is packages in our? So you can consider packages like a collection off function. So packages contained some multiple functions are available. So let's say you want to perform some sort off functionality, and it is having a multiple different forms. And 10 20 years on drinks off different facets of your club. All those functions in one particular Mardi vicious card as a back it and use efecto the our community. And that is what the packages, Oliver. So inside this, our studio, if you're going through this particular tap in the bottom right corner, finally Lord and then back it is So currently I have this many amount of packages are currently available and install on my machine off. This are so this numbers and this total number or maybe individual packet may differ on your computer. If something is not in start. We'll see in this video how to install it. How do Oh Lord, our activate that particular package and how to deactivate that particular package. So let's just concert it one of the package and see what happens. So let's see this xdm in. So currently this estimate Julie's perfectly install on my machine. So if you just select this particular portion and just obsolete here, which particular common, it will execute. So now you can see HTM Italy has been installed. It has just fire the command like a library. That's damage. So it indicates that you now currently designed stemming tool is that they are activated on my machine so I can use all the functions are available inside this extreme in Lola, model or back. As you can see, you can just simply are dis electric, and now it will be the touch. Now you just cannot use all the functions available in estimate. Now. This, HTML told, was already installed on my machines. So I just activated and deactivated. But let's say some packages, Let's say for whose realization purpose we're going to use the cheesy plot library, and that particular G plot is not available. So how we can install those cheesy plot from the serve External package minutes. A package manager is like a you can see crown. So let me just select our click on this installed part. And if you have seen, that is a one report stories available can. So if you go to Internet, where all the back are related package This is our community just created and deployed us all the package inside this grand riposte. Three. Now I want to search for let's see d c. Block so you can see immediately. It has given me the suggestion like a TV plot, and that is what we are going to use for the visit Logician purpose. So let me just select this DJ plot, and we can just simply install it. So that is a one V to install this particular packages inside this, our studio in our you're our local environment. The another way you can do it like you can lose it. It's done, not packages, and you can just supply do and let me just executed. So currently before execution, you can just see that is doggy blotter packages currently available on my back it lists. So let me just executed. And it would start downloading. Take particular package from the Internet and it will install on your local machine so that a lot of dependency might be her. This particular DJ blood packages. So it's keep downloading Lord off package. Okay, so all pack, it might be honored to download it. Now it's starting stalling all the package it has downloaded. Okay, so our duty blood has been currently Now, Lord, let me the subjective. So now let me see whether G blood is a reliable or not in my package lease. So you can see G plot is really able. Now you can just select it and you can activate it. So g plot all different. Since I really well inside this DJ plus, you can use it or you can just in the selected and you can be activate that particular package. You can do those things, you know, manually also. So you get for that. You can use the library in the same function with dessert. G Y jack box election. It is fired. We are going to use the same French teacher blood and let me just so it is. So Newsome might be May package warning or use the police package. Startup message to eliminate to Pakistan. That's okay, that's perfectly fine. But this G block go now currently in star and it is activated on my machine so I can use all those kind off functionality available in a cheesy plot and start using it. So that is what the idea behind how toe installed what regular package inside this, our environment and how toe activate and lower attack particular packet and start using the functions available inside this particular package. So that is all about the models available in our I hope you enjoyed the sending this video and see you in the next week. 15. Scope of variable: Hi, everyone. Welcome to the video. No, our programming language. Now, in this video, we'll see What is the school? Popular video. So what is the global video and what is the temporary variable? So to illustrate the concept, let me just defined this Buble. Let's see E. And I'm just putting a Laker global value. So it's like a global string, I hope, captain, and like, needlessly find one function. So score fun. I'm going to refine it. So I'm changing here. He okay, So what? I or definitely I've just calling this scope function. Okay, so let's try to understand what I heard that that I have created one variable he and after the times is printing it radio really now inside the function and changing that particular radio. But I am inside the function so earlier it was a global, and now I'm changing the value of this particular medium, and he I am inside the function. Then again, I'm just printing 80 and then school function again. I'm calling So while calling the school function. And then again, I'm bringing so this is not requiring us. So like me to sex a good this part off court and let's just think about we're planting this a variable two times. So before executing function and one is after executing fortune, you can even keep like Okay, so let me to select and just think about for a moment that the first time, when is has been printing what it reprint and after executing from should he will be printed and what it will bring. So like me to select this part and just really So he is now global like me to select this particular function and like, maybe find so school function has been defined. Let me just executed the school function has been called No, let's this call e again. So you can see he has not been Jane. Hey, still global earlier Also, it was a global So that is what global school over this medium. Now, if you see here he the value e that is a global. So that is a global environment. It has kept it. Now what happens that inside this particular function what a variable e we are trying to modifying that is not correctly this particle available. So the scope of this particular variable he is limited inside the function on. So while it start executing this particular function, it will just create this another very well. And as soon as the execution of respectable of function over it just vanished. That particular video Let me read another waiting with them. You understand it better. So another Really well, inside the function, okay? And let me just executed. Okay, so we are done exactly same thing on leading his sector. We'll change the body of destruction. Now we have to find a B or so. But if you see in a global environment workspace, that is no b has been different because the scope of this is global. That is this William not this particular a video, but me and dizzy, dizzy and disease different. So it may be confusing. That's I have taken on other very would like me. So be is not available inside this global environment. Because what happens that whenever you start executing this particular function school function, it has created this e and be very when as a temporary variable. But as soon as the execution furnace, the well scope of this radio but has been Phyllis so just vanished just to particular video he And now if I tried toe, let's a play in this me. It immediately says that object. Be not far, because exhibition of this particular functions over so our programming language. Our compiler doesn't know about what is the video, but But while executing, let's say, if you are trying toe print, this practical really will be. It will immediately tell us tech modesty. So let me just But on this Mitch so you can see like function has been defined, folks and has been called So while calling dysfunction, we're printing this me video. So insight now function X equals and we have this medium well, bees available. So that's why it has pointed another wet inside function and is as is, well, it's a global. So school has been limited inside the function. And after that, when I tried to print me, it is still saying that object me? Not so it is able to print this be inside the function, but it is outside the function. It is saying that object me? Not so that is what Just to variable what we have defined that is a temporary to this particular function and the scope of this a video, but it is a global to the function. So that is all about the scope of your valuable, global, credible and temporary variable inside the French. I hope you're enjoying the setting this regency next week. 16. Introduction to vectors: Hyoty one. Welcome back to the section on Rector's So in the last section B Hosea already basic programming fundamentals with respect to the R programming language. No, from this section, we're going to learn about off one of the very important later structure available in our programming language, like a director's. So what is directors you can consider? Rector is like Ari. So if you're familiar orbiter on it'll programming, like other programming language, like a C C plus plus or Java, mainly they help contains the bodies, and this raises like a similar to the director. So factor is you can consider as a one dimensional available in our programming language and which contains the similar kind off element. So let's say we want to create a vectors off India or are double values are some sort off characters? So let's define and see how we can create a rectors inside. This are so let's first define hurry. Let's say we have element available like Well, I think 54 67 20 through 17 8 So this you can consider is like a body. I know how you can define a vector. So for that really took close the desert to directly and in saint the our programming language. We need to use the combined function. So that is a just simple see and lectures assigned to the first week. What and discouraged symbol and hyper is equivalent to the assignment off it. So this is how we can assign create a vector lectures sexy cook so you can see in environment global very well. We found this vector one variable, which is having a total five values. 12 34 67 32 in 79. Now let's say we want to see what is the type of this record. So it's a double. So even though we held it and all the values which is a in desert in a farm, it still it saying it double because by default, all the value has been considered as a level. So to define explicitly all the values as a teacher, we need to explicitly right like a health. Okay, let me this against the execute distant vector One fight. So now you can see this type of this rector. One is indigent. So this week we can define indigent ways. Vector auto double bass Director let's define under their director of it is having a characters, so we'll use the same combined function and you like, Let's see, he one first element is a let's say, an it really mean That's ABC Third Element. Let's say I want to keep legacy and let us assign so you can see erected toe has been created, which is having all values, which is a character so character contain either one element or multiple Olympic. Let's just find out the type of this vector. So it's a character basis vectors. Apart from that, we can create our vectors off 1,000,000 users. Let's define our video with so as argument, we can just simply supply. If so, you can like the full name, like through our files or you can you just simply t and half let us find out the type off the selected three. So I'm just going to execute both of this lane so you can see that the trees now type off logical. So this way you can create and define have actors in our programming language, and you can find out what is the type off that particular records now, apart from later there were some other matters are also really well between Find out where the particular factor is. Ah knew me double or a cat. Let's take the example off Victor three. So let's see. He's no me and I want to give Vector when as a foot. So this is the function. He's new American. We can just supply record and it will return us through all falls. So it's a project means director. When is numeric main nature? Let's say we want to find back the trees. Numerical. Not so actor Reza Logic. That's why it's not a nomadic, so it has returned this voice. There are some other matter like his character, or so you can find out. So will supply vector to so it has returned. True. NEC Mints director Louisa Type character. Let's see another maker, Laker Intelligence Electric supply director. So actor one is in danger because it's true, that is someone there matter is also a teacher. Is that weather all day? Lamenting a vector is a double or not. So supply one big test, so after one is false because Oliver elements inside director when he's a teacher. So this one we can now very fight, whether all the elements are integer or a character are bullion or liberal or numeric, our programming language. So that is how we can create a new Pachter and became now verify what is the type off different rector and whether particular hacker's numeric character, indigent? Or but if you're notice wanting here that all the elements contain inside this particular director are similar types, so either it will be all character or it's ST Ager or Double aren't solvable. Let's see if we can mine some. The elements are new American nature, and some elements are, you know, character village. What will happen So even though this is our programming and you want a love it, but what effect we can will seem toe future with you. So this is the one way to create a vector inside are there some other functions are also really. But to create the victory, Not so toasting wills in tow. Next video 17. Seq rep: Hi. Everyone in this city will see about how to create this director with help to another function available in our sequence and the hurry up Minster repetition. So let's see both of them. One baby. Let's see if we want to create a one of the very deserving of some starting point and some sort of ending point and which is incriminated by some sort off some value so we can use like sequence. Let's say you want to start from one and under argument we can supply like by So let's get by by default this one only bill also keep it. So let me just execute so you can see. Now it has generated a 10 number from first values. One. The last upto end number is 10 so from 1 to 10 it is indebted. Total 10 number and every number has been incriminated by one. Let's save you on recommended me so you can see 123 to fight to 72 nights so all value has been implemented by two. Let's say instead of one, we want to start with minus fight and let's just implemented by That's a T so from minus fight to minus two, the 1/4 70 So all value has been illuminated by. So there is a three important position. Our argument we need to supply for sequence function. So first easa start. Another one is a and tendon step stays. So from which number two. Which number You want to generate the sequence, or you can see it will result in a vectors by how much amount of step you require from going toe one element to the candidate. So that is how you can create the sick of actors with help of this sequence. Foot. Let's see the another. So that is the sort. Could you can see off the repetition? So let's see. You want to repeat one number or anyone Character. Let's see. E lets him Friday names on six times, so he has been depleted. Total six times. You can even do you like a baby, and every will be repeated toe six times. You just cannot give ah character. You can given William very well. Also. So Protrude group become started six times. You can even give you any kind of number. Let's say 34 should be pretty six times so the basics index behind this rap reputation function is the first. Well, you you need to supplies. Like, When do you can see the next? We'll use the reputation that how much amount of life you want to do. Deputies. Let's say you have one already. Let's define once in director, we tend public's combine function. It's a running through in physics, so we help one in doing execute in. Ex Now has a vector. No, don't we want to repeat this one, too? As a whole, Rector lets it three times so we can use the function like our E P and instead of passing just a single number or are double number or any kind of character or logical value became even supplied. Full vector. Also so X. And then the next time human, let's say we want to repeated three times, so it becomes one toe went to went off so want to be repeated three times a year. One musical language. The video X. So that is our Delp of this To function in our sequence function on a rap minster repeatedly from so you can create vectors. So that is all about how to create a vector. Tell properties two more functions available in our I hope you enjoy listening to you and see you next week. 18. Vec diff type: Hyoty one. Welcome to the video Now vectors. So till now, whatever the factors, we have created all the factors having a kind of similar elements, so either can be a double order can be in danger. What can be a character or any kind of our logical values? But let's say instead of are supplying similar later types, element inside deserve actor. Let's say we want to supply the mix off element. Please let us create a simple one and let's see what effect we come. We'll use the same combined function. Let's say the first argument first element people into supply later and instead off passing another logical values like a true and forth like this supply. Oh, any character. So now we're supplying that to this similar kind off limits, and 1st 1 is a logical value and under one is a character. Let's see what happens. So you can see now true becomes a string off so they doesn't remain any kind of logical value. But instead of data, it has converted boat off them into characters. So he was already a character, so it becomes a and another one is a true so true becomes true in a case off character list of character or you can see Street it, it is not, remains as any kind of logical value. Instead of the four character through, let's use another one, let's say, instead of passing character, let's Supply and in digital radio So now throw becomes of one and two in victory becomes 21 . So in a boat the case over converts it is completely different because in our earlier case they become what they will be a pass, geological, diluted become any kind of character. Now, in this case, based on the other way, lose a really well indigent. It has converted this true in tow. One. Let's say, Instead of us a group, let's would have so half becomes Jill and turned. It becomes 20 has seen this this one. Let's use that. Let's see. First Element will pass it. Nick. Let's see now 19 is a number, but it's it's not a number. It's in a sting for me. Pain. Another argument. Let's see. But that is as a number. So now what becomes a strength? Let's give, uh, any other character. Let's see, and another argument will supply click number so he discusses the both of them. Make a much thing. Let's see a will last Monday, Well characterised. So in this case, are so both of them become a string. So this way, once you supply the mixed data types while creating any kind off vector, these are will automatically decided one of each particular common later type. It is going to create this particular wrecked. So that is what the gun was. An RV. Dubin automatically decides, Tector, on which particular data type I'm going toe create this, Mac. So that's all about this freedom and see into next video. 19. Vector names: Hi, everyone. Welcome to the really own reckless In this video, we'll see how to give the name to the particular element off directors. So it's Laker director of names. So let's first create a very simple vector. Let's see, I want to create a vector off stop leader. It's a stopped pickup for next three days. Monday, Tuesday and administer. Let's see. Okay, let me just exceeded. Now if you're absurdity it in this particular stock leader of Vector, the indexing is starting from one to entry instead of that. Lexie, we want to kill the next thing. Laker desire Munday stock is accused a stop and business the minister stop. So how we can give such a kind of customize particular name individual element vector elements. So for that, let's create a little victor, which is having all indexing where you let's say first. Owen is on Monday on the next one is that Giusti? The Last twenty's Majesty lectures a sane name function and release placid stock. Okay, so what we have done here, actually letting me help created indexing name like a Monday Tuesday in Venice. The envy are going to assign it toe our existing stock data tell public's function name The name is a function and we're passing the stock data value for a stock later Vector what we owe Onley creating. So let me just execute. Okay, so before execution like to spring this rock Crist So you can see it is a plane stop data it has no indexing associated with tech provide a full indexing is forced to allude his second value And this is the target. So indexing has been referenced by 12 and three will now let me to succeed despite names And let's just again execute this tablet So now you can see the 1st 12 years Monday so Monday to 30 for you State to ratify in Venice t attracted. So in this way we can put this name for mission You can you a particular name to an individual element of this vector? So that is all about how toe give the names toe individual particular element of this vector. That's all about this video. See the next video 20. Indexing slicing: Hi, everyone. Welcome to the videos on the vectors Now in this city over easy. What is director indexing and how to slice the data from Rector? So if you're observed, or if your family, the other programming languages like C C plus plus or Java most of the time in our their phenomenal data structure Laker in early the next thing is starting from Zito. But in our it's the little different that it is starting from what? So we should keep boosting in the mind. Every element in a factor is starting from indexing with. So how to get some particular element in a vector returned from this indexing value or hopeful? Do the slicing we're going to see in this video. So let's first create a simple rector. Let's say we will put the daytime Toe X and Lexus defined he be There's a scene half g. So total seven element I O captain. Now all the values which is in next year, starting from anyone so one is referencing toe. A second is referencing toe. Who is referencing toe me threes referencing See? So let's say we want to grab the very first element so we can use like a bracket noticing. So, along with their video, relax. We can use Laker one, so it will return is the first element. So first element is he. Let's see if you want. Oh crap, let me. So these off US second card in four television so foot. So for Disney, their total seven elements are there. So let's say we want to crap the six telling me six or sixties have. So in this way, with help of indexing, we can grab the individual element of this vector. Now let's say we want toe exclude some element. Let's say the CVE we want back slowly and it should return us a whole bunch of all letter values so we can use the negative indexing so you can write Laker minus three so the third element will be completely removed. In all Other element will dreaming. So now you can see it as the return is there on a director, which is having all element AP the FT what C has been people. Let's say we want a little just a G. You can use Laker. I was selling so a B, c D E f, but G has been with him. So that is, you can consider his Laker negative. Indexing is a single element selection. Now let's see another V to select a multiple elements. Let's say we want to grab element from me goodly So he has been referenced with her index, too. And he has been indexed with reference for so 23 and four. So we want to grab three elements. So how we can do so for that? That is our little bracket notation out there like a first argument. We need to supply like a start and then colon in the end so we can write like, picks. So starting value, Let's say so. Who has bean? So is there a friend seemed to me and then 23 and four So anything will you will keep it like a four. So from two before on starting an end has been separated by this Such a thing of colon. Let me this activity. So now you can see from do three and four Telemann. It has returned us. So it becomes me. See, Handley. So because this is to these 3/3 element you Quincy and this is for television. So your upper bound is not excluded, if you will seen in other programming language. Most of the time, this upper bound has been absolutely but here for the element has been included. Let's slice down the value for another six. Very well. Our another sets. Okay, let's say we want to grab he f Renji. So just pause a video for a couple of second and think about home. What? The next thing value will use toe Grab the value from he to G. Okay, so he has bean have friends. Victim number three for fight, starting from side six and seven. Okay, so he half hang g. So we have seen about particular single element French or are negative indexing range of values. You can see me CD or you can just see Andy. You want? No, Let's see. You want to grab be the any now you want to actually see also because it is not in a sequence l in a nature. So BD any so me has been difference. Waited too. This is fourth and 1/5. So we want to grab element. It is having a indexing name for and fit so far. Doctor, we can use the same notation and we can just supply Laker another body. So we'll use the same combined function, and we'll just some supply four fight. Okay, So what happens that it will return us, go for and fire women away? And those particular element only it will return from this tax. So I mean de any Okay, let me just, uh, got it. So you can see No, it has the returners media. Any as well supplied director, which is him All values who for and fight. So if you want to grab some particular element which is not available in a side by side or in a sequence shed inside this particular vector, then also you can grab it. You can use even on negative next thing like, let's say you want to exclude instead of just one element to be a earlier. Excellently, we want to exclude BNC anti meaning all elements. We want to grab it so we can use, like, let's say, minus to minus study. So now you can see from photo three has been in Absolutely so he the he have Angie. It has returned us. So this way there are number off base. We have seen how toe fetch the data from particular vector. How to fight one particular element harder whole packs loaded, one particular element. How toe off, Fetch the data from some starting position toe some ending position. Even we are seen hopeful and grab some particular sets of data based under vector your supply Desert input argument. Notice, um, bracket notation and you can exclude some range of values. Also, me and CBO it's late. We tell about such a kind of negative next thing from stock who made on little difference is there to be a given the extra hype on which indicates that it's a negative in next. So that is all about how to indexing and how next thing and slicing box inside this vector . I hope you enjoy listening this video. If you don't understand anything, please bme or like those thing are in to discuss and forum. So that's all about this video seeing the next with you 21. Comparison oprator: Hyoty one. Welcome to the video. No directors. So in this video we'll see how to apply any kind of comparison Operator on the top of this rector. So for that lettuce definer first. So let's define accent Italo Right to sex. Whatever text really partly created. Really Use the sequence function from 1 to 10 sequence. We're going t like me this spring. The sex so excessive value one putting. Now let's see. We want to find how many total values inside this vector X having a value greater than four . And how many of them? Harder, Less than four. So begin to simply use Lega X is greater than so. It will return us wherever the values is less than four. It will return the files and re many all the underbelly 80 litter through. So that is how the comparison operator Now let's say we want to find Onley does well you. This is greater than four so we can use like a bracket notation And inside the bracket notation begin your condition. So the first X is greater than four has returners very well. The value is greater than 4 80 was return through. No once you supplied output off this particular condition output, which is you can call it as a filter and that filter ones who supplied it will just certain only those element where the values is true. Because you can just mentally put this food a day through falls here inside this bracket through funds voice for send in six times. So electricity executed So it has returned the six element where all the values are greater than four. That means this field as a tent for even you can assign it through some sort of filter, and we'll just supply the feel of you. Okay, let me just execute first of freedom. And let's just spring is filter, so Filter has a tent, the areas off full for central basically condition. And once we supply this reader inside this tax bracket, notation off the sex, so it has returned us 56789 10 because all those values are greater than four, you can even combine the condition also, so instead of just greater than for Let's say we want to combine the condition like ending greater than four analyst and eight less than it. And let me just definer filter and logistics print this filter function so it has returned true wherever the value of X is greater than four and very were the value off access less than it. So only three element is where the values through now lectures exhibit this ex filter so it has returned 567 So all kinds off logical and a comparison operator you can combine. You can create the filter, and those filter you can supply as argument to the bracket. Notation off this vector, and it will just serve return based on the free parking no, wherever the filter condition medicine filter can descend returns through. So that is all about how to use the comparison operator and different logical operator combined together to create a filter and how toe freighter Some particular sets off elements only based on the matching criteria are some sort off some condition. So that's all about this video seeing do next. Video 22. Basic vec operation: Hi, everyone. Welcome to the video. No vectors. So in this video, we'll see. What are the mathematical operation we can perform under top of? So for the Lexus definer, Who better and let's see what are the operation? We can perform on a different situation, so I'm just going to define it here. Let's say one 0.4 in veto on attacks. Director we're going to define So let me ask you price So eight. And let me just execute more tough them so even and veto SB defined. If you just spring everyone I want to stay for and feet 56 70 now Moto the vector having the same length. So if he just perform a simple in addition, so element by element tradition, it will do so. One plus fight becomes six hopeless. Six become eight, then 1000 Well so element by element operation it has now. If you just use the subsection same, a subsection will happen That element by elements obstruction it will do. You can do the same thing like a multiplication. You know those. So it's ah, so far so good and so simple. But now let's say let's there some sort off little complexity. Let's keep our V even as it is like a 1234 And let's create another Laker. And inside the victory, instead of writing the four elements, I'm going to create the victory vector, having just a new element. So let's see. It's just the five and six. And now suppose VVe perform really well and we three what will happen that even is having a total Ford element and victories having just dwelling fight in a six. So let us visualize it here. So one, 34 and here fight and six So here one and five will be added to and six will be added. But what will regard it with its three and four? So, in this case, what are we do? It will extend this particular director, and it will just repeat this fire and six multiple times. So here, also it really picked by five and six. So it will just replicate more table directors is available as this There is ah element available in this Sweetie Victor is a multiple off. No number of elements available. Lena of even Victor. It is easily replicated. So let us execute and see and very fighter is it? So one in five becomes six. Let's perfectly fine to win. Six. Make a meat three and fires have become eat in four and six makeup then. So, so far. So good, because we have a total two elements in a victory and a four element dina of Even. And as there is a multiple area multiples off elements are available in a victory, which is a multiple soft, total number of elements available in a V one it has easily replicated. Now suppose let's define before and instead of fire and six even define 567 now movie, huh? One Before and in another victory, we have 56 and seven, so the fault element is lost. Let's say now we suppose will perform even plus before, so it will return us better. Warning. So warning is saying that the longer abjectly is not a multiple of assorted abjectly, so the sorter object is three three element before so three element and under one is having foretelling. So three's not a multiple off you can see for is not a multiple off the tree, so the longer object for four is not normal people after sorta object length three, That means, er it cannot perform hosting. But still it has a returners. The result. So it has given us to something like one plus five becomes six so six become eat, please own become thin And at the last element where the value is missing it has against start replicating so it has upended. Let's see, this is fight So 54 plus five makeup night. So the Operation Vicious perform earlier he not went four case, which is exactly similar. It has replicated here. The only difference is that that is no intention Multiple off this longer object to the sort of object that it is able to replicate only one elements off. I only has been repeated one time, but here fired six. Mood has been repeated because it has a space for the swelling. But here in a second case, in a case off me for me I was space for just 11 element only begin even perform at the operation like my delegation also so you can see the same warning message yoga but it is able to perform the multiple it is is like a 15 become fi 26 12 and then 21 then 20. So it has able to do those meticulous. So So this is how they're rector. Performs some sort of basic arithmetic inside this are that if you are having a boat, the vector visits all the same leg. Very good. It will just do element by element operation. It will perform if you're having a different length in both the vector like a rector, one invective toe. In that case, it is trying to replicate the vector and trying to fill the missing value and make it the same size for voter vector vector one, Inspector Dew. And after that, only it will perform those added medical, please. So that is all about how to perform arithmetic inside on the top of this vectors in our programming language, I hope you enjoy listening this video and see you next week. 23. Vec nonvec: Hi. Oh, even welcome to the video directors. So in this video, we'll see What is the non victories operation involved is the victories operation. So to illustrate the concept, I hope already created a small code snippet. Here it is just trying toe creator co rectors off us similar length and just try toe ad with non victimizers and and money's effect raise was and we'll see what is the difference will get in terms of the time execution. So if you are sucked a court number, I have defined like 100 So total number off element you can see. So Vector One is generating 1 200 element and wrecked it also originate 12 number minutes 100 element in this case and after they just non vector is some io created and with help before look water we usually do you know, some other programming language. Where there is no factories, implementation off has been given. So for each individual element, it will just simple true from director one inverter to and if we decided and put it in the non victor, some vector along detector is another. Rectories wasn't which will just do all the same task in just a single line off court instead of writing is full, Huh? For you. So just tractor one in Vector took it. We just do it. So for first time, we'll just do the experiment with 100 element. So let me just select this full part and so you can see immediately it has exhibited. And given the whole visit seemed way The victories, words and we also so factories was an output also vo instantly God, because we are just doing the operation on 100 telling me now let's just increase it. Major 100 things. Let's make it 10,000 and lectures through the experiment again. Now if yours of the little time it has taken it toe executives 10,000 but indirect arises immediately got the output. Still, that is no different status 10,000 enemy. Let's make it a little bit bigger. So more zero I already so values close to one million number We're going toe had it and just executed So you can see it has taken a little time but in a victories wasn he doesn't in almost instantly veal got the No, let's decide one more and trust collect notice executive director Vernon Victor. Now let's just execute this non vector is worse than off court. So I just 10 million number so you can see still running, and it's taking a good amount of time. So it has almost taken 3 to 5 second around toe. Execute this particular portion off. No, it's a applying this 10 million Number two. Every detail of this victories wasn't off course, so you can see instantly vo God the value inside this vaccine. So it is highly recommended practice whenever in any programming language. Most took the time, especially let's talk about the R programming language. So in that case, if you have acted eyes implementation is available. Better use dis vaporized implement isn't because it's a highly efficient, highly fast and very much time. If recent, you can see any texi goods very much fast in terms of performance. Also, because there is a lot off parallel implementation and trade, basically irritation it has internally might be doing. But if you are going with your own for Liu Bei's implementation, which is highly sequential in nature, so it will take a good amount of time to execute it. So in somebody doctor event over the victories was and off. Any functions are available to do any kind of arithmetic or logical operation use. That particular from the place was so make your program even more efficient and front execution will be very much faster. So that is what object to behind this video that vie to use the factories wasn't over. The non victories was in a village inside this our programming language, because in non rectories was and unique to write a good amount of order. Also in factories was in just a single line. Off court Vo performed same task. So that's all about this video see into next video. 24. Vec summary1: Hi. Oh demon. Well, welcome to the courts, on a program and in DeSipio we'll see about rip somebody off what we have learned throughout this, a whole record section. So throw the section. We'll learn about more this director. How to create a vector With help of this combined function sequence function in a deputy's in function, we learn about how to view the name, toe individual element off director, how to do the indexing and how to slice the data from this director. We have learned about how to filter that they target help of this company's an operator. And what are the basic optician you can perform under top off Victor and we'll learn about what is the victories operation and what is the non vector is a prison and how rectories operation is much, much faster than non victories office. So we have learned about the enough concept related to the vectors. So now it's time to jack over knowledge about the directors. So for the guy who created when exercise and what Chris. So let's just go through the questions on a quiz. So all the questions in a disaffected quiz are a little bit tricky. So I would highly encourage you to go through the each and every questions and create your own solution. In the next video, I will know Go through the solution off, eating every video and we'll explain in a duty how next solution has been so seeing two solution with you. 25. Vector solution: Hi, everyone. Welcome to the solution. Video off this director exercise So like me to select all the question and like, just switch over toe our studio and we go through the solution off each and every exercise problem one by one look. So I only pasted this question. So let's just go through. All of them went payment. So let's start with the 1st 1 So first just saying that you need to create a factor who's all value has been divisible by three and you can use all the values or numbers between Dan 200. So eventually we need to create a vector where we are allowed to use all the numbers between 10 200. But we need don't include only those number, which is divisible by three. So we already have learned about sequins function so we can use the sequence function and we can just give the start range inner and brings like, generate all numbers make intento 100 in agreement it by you can see point but here as we want all the number to be divisible by three, we want all numbers toe being cremated after every listen my tree so we'll make the incriminated counter like a tree has a hard argument to this sequence function and like to see what it will generate So you can see that all value has been cremated by three so 10 to 13 to 16. So it has generated the value between 10 200 every single value has been incriminated by three compared to its previous will. But still our first condition has not been satisfied that all value should be divisible by Klay as well started from 10. It has incriminated three and addict three tow this particular thing. So we already know that after 10 the very immediate the first number which is the visible by three desert. So instead of starting from then we can start from 12 and let's see what it was. So now it's correct result that it is starting from well on No well is divisible by three. Now it is incriminated by three so rich to 15 and 15 is also divisible by three. So in this way, vo successfully creating is a factor was all value has been divisible by plea and we're use just only those number of it is between 10 200. So the tricky party it is toe not using this pen. And instead of that, you can use it. You can use the other beyond, so you can generate Tizard Italico for Looper all those. But the idea here is to learn about this function. Like a sequence of it is mainly used to generate such a kind of sequential data in a director forming. So let me this assigning one director. Well, even so, it's so let's go to the next one. Now we have created to surly and this factor was always user divisible rectory. Now they're asking how many of the total value, the visible way nine And whatever the value generated in the last exercise problem, all the values are divisible by three, but not necessary. All the value will be divisible by night. So one way we can tackle this problem like you can treat over each and every element of this particular director. And you just try to find where the that particular value is divisible by nine or not. If it is divisible by nine, you can just increment the counter movement and it will give you the results. What other total elements are divisible by nine from the vector. What's the alternative? But we are not going to go through that particular approach. That's like a super near approach we're going to use. The filter isn't criteria, so the faster let's toe try to find it. What other values, which is divisible by night. So for that, we need to compare this each and every individual element of this particular vector, and we'll try to find that particular record. Elements are divisible by nine or absolutely visible by nine on so well, find a Modelo prison my name, and we'll compare the reminder because he so if the reminder is zero when divisible by night, it will return us. They deserve the places where we'll use our divisible way. Nine. So let me just execute so you can see the first, will you? He's what we a genetic trait which is given a false that miss It is not divisible by 9 15 not divisible by 9 10 Committee then immediately came through fragments. It is divisible by night. No, we need toe. Find that how many off poeple values are divisible by night, not reach of the values that divisible mining. So our objective is to just calculate dicta. How many total through Williams Are they inside doubt off this particular operation? So we can just simply use like some function and we can just supply this particular argument. So this argument village Ernest proof oyster voice value and some will return us. How many total pro will use that? So you can see now dinner total 10 values which there true in so output off this particular operation that means they're totally n values inside. Director, what we were really is generated having a value which is divisible by night. Now let's say we want to see the water goes well you which is divisible by name so we can just simply use like a vector bracket notation and we'll just supply this particular condition so very where the values are divisible by nine it existed. Return does well you and remaining value Wherever the values are not divisible by name, it has written false statements Those well you will not be returned. So now you can see between 10 toe 100 whatever the data views and let it this data So from those number only this 10 values are indivisible night. So we have gotten it. Their total 10 values, which is the usable by name. So let's go to the next one. Now they're trying to find it. What is the average value of 1st 10 element? So let's just first spring all relevant. So our objectives to find 1st 10 elements of disease 358 and then. So we need to find the average value of this first Keneley. So let for sir. Fine. 1st 10 element. And then we'll apply the every Georgia mean operation on the top of first. Finally. So to find the 1st 10 element inside the vector became this he was this sliced Notice it and it will return us the 1st 10 million. So 12 to 39 and we'll apply the mean office. So it really tried to find the average value up the 1st 10 element. Okay, so there really is will use 25.5. No, let's see another one. That's it. What is the maximum values and meeting between 50 and a 70. So let me the sprint, this victor No, By looking at this area, you can see deserve the value which is between lies between 50 and a 70 out of that 69 is the maximum. But we need to find a programmatically be so how we can achieve it. So for that, let's first find what are the values are there between 50 and a 70 after that will apply the max operation like find the maximum value out off those numbers. So let's first fine all the value. It is greater than 50 Kendrick Liston 70. So it will return us on the those value, which is greater than 50. Analyst in 70. So we lose our 51 to 69 Now we can simply apply the Max operation under top off it and citrate on a 69. So it's got it. Let's go to the next one. So create another vector filter. So we need to create one filter of it, which is all very lucrative it party. So we can just simply compare like director operated and 30 and it will return us in the body off buoyant force. So very well, the values greater than 30. So after this particular point, always use a grated intact, so it has return. But true. Now let me to society Freaking so that is what Nothing but the film director like to spring this filter So again the desert kindness the other day off for you can see in the vector of it is having all of element fall Cento so very well the values less than 30 It has returned force and all remaining place It has returned no really toe find all those where leverage is greater than party. So we can just simply apply this filter as a part of the argument to this bracket notation when we apply on the top off this vector medium Okay, so you can see deserve the value which is greater than 30. And it has returned us with help This particular hope. So that is all about five different exercise problem Have you gone toe? I hope you enjoy the sending this video and see you next.