Pages

Chinese 中文主页

Chinese 中文主页

Publications 著作

Publications 著作

Projects 项目课题

Projects 项目课题

Talks 报告与教学

Talks 报告与教学

Students 指导学生

Students 指导学生

Media 媒体报道

Media 媒体报道

Video 影像记录

Video 影像记录

Miscellaneous 杂项

Miscellaneous 杂项

Handouts

Git

Git

Modern Statistical Graphs with R

Modern Statistical Graphs with R

[link]

Info
  • Speaker: Peng Zhao (Department of Health and Environmental Sciences, Xi'an Jiaotong-Liverpool University)

  • Time: 13:30 -- 15:00, Dec. 8 (Wednesday) 2021

  • On-site: ES211, South Campus of XJTLU

  • Online: BBB, Access Code: 560567

Perquisites

  1. Knowledge in R. We assume that you have fundamental knowledge in R (e.g. you have taken part in the XJTLU Library's previous training for R beginners). If not, this training might not suit you well.

  2. Installation. The PCs in the computer room are ready with R and RStudio. If you use your own computer, R must be installed, and RStudio is recommended.

  3. Packages. For saving time, run the following code in R before the training (if you are using the public PCs, please arrive 5 minutes earlier and do it):

 install.packages(c('beginr', 'ggplot2','Rcmdr', 'ggplotgui', 'GrapheR', 'plotly', 'GGally', 'remotes', 'MSG', 'fun'))
 remotes::install_github(c('pzhaonet/fecitr', 'pzhaonet/mindr'))
  1. Data. Download the data file participants.csv for the following examples.

Why R and why not R

 plot(0, 0, col = "hotpink", pch = 169, font = 5, cex = 50)
 text(0, 0, "XJTLU Library", cex = 2)
 points(c(-0.8, -0.5, 0.5, 0.8), c(0.5, -0.5, -0.5, 0.5), pch = 169, font = 5, col = "red", bg = "red")
 ​
 demo("ChinaHeart3D", package = "fun")

learning-curves-of-popular-stats-programs.png

Show time

Graphical User Interface

 library(GrapheR)
 run.GrapheR()
 library(Rcmdr)
 ggplotgui::ggplot_shiny()

The Deducer package

 library(Deducer)
 JGR()

 

Programming

  • Basic system

 x <- iris$Sepal.Length
 y <- iris$Sepal.Width
 plot(x, y)
 library(ggplot2)
 ggplot(iris) + geom_point(aes(Sepal.Length, Sepal.Width))
 library(beginr)
 plotpch()
 plotcolors()
  • The fecitr package

 fecitr::plot_summary(iris, base = "hist", if_box = TRUE)
 library(GGally)
 ggpairs(iris, aes(fill = Species, alpha = 0.1))
 library(MSG)
 Sys.setlocale("LC_CTYPE", "Chinese")
 msg("3.11")

Further readings

Homework

  • What are the differences between plotting graphs with R and with Excel? Compare the pros and cons.

  • What do you think about the role graphs play in your study/research?

Recording

Details

Comments


Add comment

Fields marked by '*' are required.
Comments are moderated. If you choose to make this comment public, it will not be visible to others until it is approved by the owner.

Reply to:

Public
Private: This reply will only be visible to you and the author of the preceeding comment.