Skip to content

jiangworms/data-visualization-GCI

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 

Repository files navigation

data-visualization-GCI

To complete the "Data Visualization in R with Lattice Graphics" task, I followed the following steps:

  1. I created a numerical variable "salary" and put 15 numbers in it. These numbers are pretty random.
  2. I created a numerical variable "age" and put 15 numbers in it. These numbers are also pretty random.
  3. I created a numerical variable "height" and also put 15 random numbers in it.
  4. Then I created a character variable that includes three types ("Doctor", "Teacher" and "Police").
  5. I put these data togather and made them into a DataFrame by using the data.frame()function. Although the data are generated by me abitarily, but it now looks like a set of data describing the height, salary and age of a group of people whose occupation may be doctor, police or teacher.
  6. I introduced the the lattice library by using the require() function. By doing so, I can then graph the data into scatter plot.
  7. Because the task says that "plot a scatter plot -make a plot from data shown above in two different panels, split by variable z -Make two data series on the same plot", I dropped one subset from the original dataframe. All the observations of doctors are dropped.
  8. Then I graphed a scatterplot with two panels: one describes the relation between teachers' salary and age, the other describes the relation between polices' salary and age. Here I used the xyplot() function and I referred to https://www.tutorialgateway.org/lattice-scatter-plot-in-r/.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors