Publications by Ching lee yan

Document

23.03.2020

第一題 read in a plain text file with variable names and assign a name to it dta <- read.table("C:/Users/USER/Documents/math_attainment.txt", header = T) structure of data str(dta) ## 'data.frame': 39 obs. of 3 variables: ## $ math2: int 28 56 51 13 39 41 30 13 17 32 ... ## $ math1: int 18 22 44 8 20 12 16 5 9 18 ... ## $ cc : ...

335 sym R (2199 sym/20 pcs) 3 img

Document

26.03.2020

第一題 Load the data dta <- ToothGrowth head(dta) ## len supp dose ## 1 4.2 VC 0.5 ## 2 11.5 VC 0.5 ## 3 7.3 VC 0.5 ## 4 5.8 VC 0.5 ## 5 6.4 VC 0.5 ## 6 10.0 VC 0.5 example(ToothGrowth) ## ## TthGrw> require(graphics) ## ## TthGrw> coplot(len ~ dose | supp, data = ToothGrowth, panel = panel.smooth, ## TthG...

1042 sym R (9033 sym/62 pcs) 9 img

Document

27.03.2020

第一題 load the data dta1<- read.table("student2017.txt", header = T, stringsAsFactors = F) the missing data in the fifteen,so revise data dta1<- data.frame(ID = c(dta1[1:14, ], 'U76067010', dta1[15:16, ])) names(dta1)<-"ID";dta1 ## ID ## 1 D84057058 ## 2 C44035023 ## 3 D84041162 ## 4 D84046081 ## 5 D84021057 ## 6 U36037...

410 sym R (3920 sym/24 pcs) 2 img

Document

19.04.2020

第一題 Use trellis graphics to explore various ways to display the sample data from the National Longitudinal Survey of Youth. read the data library(readxl) pacman::p_load(readxl, httr) dta1 <- read_excel("nlsy86long.xlsx") str(dta1) ## Classes 'tbl_df', 'tbl' and 'data.frame': 664 obs. of 9 variables: ## $ id : num 2390 2560 3740 ...

1145 sym R (3687 sym/22 pcs) 16 img

Document

24.04.2020

exercise1 Find out what each code chunk (indicated by ‘##’) in the R script does and provide comments. plot(women, type='n') ##Draw women's data, parameter type, n is not drawn points(women[1,])##Draw the first data in the women's file (58,115) ## lattice to draw the weight Y and X lattice::xyplot(weight ~ height, ## define weight (Y) ~ ...

804 sym R (8827 sym/39 pcs) 12 img

Document

17.05.2020

exercise2 Revise the orginal riffle function with the approach taken in the latter. riffle <- function(x, y) { z <- NULL count <- 1 for (i in 1:max(length(x), length(y))) { if (i <= length(x)) { z[count] <- x[i] count <- count + 1 } if (i <= length(y)) { z[count] <- y[i] co...

315 sym R (2270 sym/16 pcs) 3 img

Document

30.05.2020

package library(statnet) library(igraph) construct graph g<-graph.empty(directed = F) # 增加node g<-add.vertices(g, 3) # 增加edge g<-add.edges(g, c(c(1, 2, 1, 3, 2, 3, 2, 1, 3, 2, 1, 1))) V(g)$label <- c("a", "b", "c") V(g)$co...

1057 sym R (17699 sym/67 pcs) 27 img

Document

14.06.2020

6/15/2020 Outline Data preparation Data Wrangling Visualization -Sourse: Medical Center in Southern Taiwan Check data names(dta) ## [1] "area" "ID" "gender" "age" "bmi" ## [6] "SBP" "DBP" "bodyfat" "waistline" "hipline" ## [11] "wh_ration" "upperflex" "stand30s" "walk" ...

2285 sym R (7545 sym/18 pcs) 17 img 2 tbl