Tip:
Highlight text to annotate it
X
Previously, we have done R introduction 1 and 2
This is part 3!
so in part 3, we will
talk about the "Graphics"
Graphics is a very important part
of "R"
and there is a command -
basic command actually - this is
"plot"
and we use
x, y
see the plot!
Go to graphic device, which is active,
see?
This is from x and y
so, what was x? x was 1 2 3 4 5
and y was 6 to 10.
That's why when you see the graphic device,
its like 1-5 and 6-10
this is the "plot" command
for the 2 dimentional plot
For 1 dimension, you can also plot it like
plot(x)
you will get some graphics for 1-10
x is also 1-10
sorry, for 1-5, x is also 1-5
So, this is how the graphics device is turned on
We could try the boxplot -
of x
yup, looks like a boxplot
and then the histogram
of x
So the histogram
or we could try the plot -
density
Yup - this is the density plot
of x!
So, this is how the graphics device works!
And you could see
the help file
if you want to know more about how to plot
- or the more parameters in it
For example, try help of
"plot"
ok!
Here is x,
here is y -
we could use
"type"
what is type?
lets see - what is type
yup!
Previously we had plot (x, y)
I just go to history
by presseing "UP"
and I try type equals line
"l"
yeah!
Previously it was dots,
now it is line
and see there are other types like "p" for points, both for "b"
and so on
we could used the main titles,
sub title like this
main
equals "my title"
yeah -
you see main has "my title"
and close
and similarly, you could go for
subtitles as well, x-labels, y-labels, and here is some details,
and, you could also see some relevant functions
and nice examples!
So, if you want to
know more about these commands,
about histogram - just type in like this!
and there is
whole lot of literature to look up
and see about its use
and there are nice examples.
You can learn how to use them, that's it.
So, now I will show you how to save whatever you have done so far.
To save, you could just cross it
"save workspace image"
if you press "yes"
the workspace will be saved
whatever you have done so far will be saved
and when you come next time,
go up
and look up the history
everything will be there - the "x" variable that you put here 1-5, "y" variable 6-10,
everything will be there.
But if you press "no"
everything will be vanished
and
you have to start over again!
That's it!
So, this is the part 3 of "Introduction to R"
Hope you enjoyed it :) See ya!