Data Science Initiative Introduction To R Bootcamp (part 2)

Initializes a plot with some data almost invariably we say here’s the data that you’re gonna in which you will find all the variables.

Then we basically come along and say okay I want to draw a scatter plot cuz that’s the point I want to point plot or scatter plots and here’s the X variable here’s the Y variable and by the way I’d like you to change I’d like you to change the plotting character based on the value of bath remember bath is 1 2 3 4 or whatever it is okay okay.

So that I basically start saying if you if the bath it has a value of one I want you to plot it using a plus if the value of bath is two I want you to use a circle of my value of bath is three I.

Want you to use a triangle so we like to be able to see that encoded in the plotting character these are.

Mapping there’s a hundred and seventy five values four bedrooms one hundred and seventy five values for price we’re mapping bedrooms to the X the x coordinates price to the y coordinate and then we’re mapping bath to the shape aesthetic okay is this clear wasn’t clear to me the first time I read it okay what the heck is an aesthetic okay but it because it’s not what we see on the screen.

It’s actually it is actually the characteristic in the plot so this is Oh before we.

Render anything we have a shape okay but then we will render it in that particular way but we’re mapping these variables okay and notice by the way I don’t have to say Davis dollar bedrooms or Davis dollar price it’s just I just use the variable names and it.

Will find them over here in the there in the data set that I locked into the pot the ggplot this clear yell yell any questions you have okay so.

You might have noticed that I have a little comment at the end here that this fails miserably okay does anyone know why I’m showing you the code below so hey again I I stopped dead when I get an error I see that everything that’s happening this.

Is what’s happening in in like.

I call I call things and it’s printing a ggplot that’s building a GT plus all these are all the action these are all the activities the error happens the the error happens way down here oh my god I’m thoroughly lost.

I didn’t write this code I’m thoroughly loved how the heck do we debug this I don’t know but but we look at the error message a continuous variable cannot be mapped to shape so what should I do discontinue the gun go away very what do I need to do and again I part of this.

Is when you’re using our what when you when you’ve got a.

Lot of experience in our you probably you can probably write it write a command then you get the right and you get an answer.

And it’s done okay I took you’d probably make a mistake a few typos here or.

There okay just so it just you got a syntax error then you get an error because you actually had a think oh and you just typed the wrong thing you need to be able to recover okay and the first couple of months that you’re.

Using are will be incredibly frustrating okay because this is like oh my god every single thing I do is an error and I cannot read the the the error.