Publications by TJLee

Document

09.04.2020

##載入兩筆資料 dta1 <- datasets::state.x77 dta2 <- datasets::USArrests ##看資料 help(state.x77) ## starting httpd help server ... done help(USArrests) dim(dta1) ## [1] 50 8 dim(dta2) ## [1] 50 4 head(dta1,n=10) ## Population Income Illiteracy Life Exp Murder HS Grad Frost Area ## Alabama 3615 3624 2....

84 sym R (5772 sym/24 pcs) 1 img

Document

13.04.2020

#load&see (use lecture note p.3) library(datasets) fL <- "http://www.amstat.org/publications/jse/datasets/sat.dat.txt" dta <- read.table(fL, row.names=1) names(dta) <- c("Spending", "PTR", "Salary", "PE", "Verbal", "Math", "SAT") str(dta) ## 'data.frame': 50 obs. of 7 variables: ## $ Spending: num 4.41 8.96 4.78 4.46 4.99 ... ## $...

6 sym R (1451 sym/6 pcs) 1 img

Document

13.04.2020

04-13-In-class exercises-1 TJLee 2020-04-13 #load data& see it /when df=3 # x <- seq(-pi*2, 2*pi, .05) z <- dnorm(x) y <- dt(x, df=3) plot(x, z, type="l", bty="L", xlab="Standard unit", ylab="Density") polygon(c(x, rev(x)), c(y, rev(z)), col='aliceblue') lines(x, y, col='cadetblue') ### #when df=10 # x <- seq(-pi*2, 2*pi, .05) z <-...

66 sym R (790 sym/6 pcs) 3 img

Document

23.04.2020

04-20-In-class exercises-2 TJLee 2020-04-24 ##load & see data <- read.table("/Users/Tjlee/Desktop/weather/langMathDutch.txt", header = T) head(data) ## school pupil IQV size lang arith ## 1 1 17001 15.0 29 46 24 ## 2 1 17002 14.5 29 45 19 ## 3 1 17003 9.5 29 33 24 ## 4 1 17004 11.0 29 46 ...

63 sym R (3273 sym/17 pcs) 2 img

Document

20.05.2020

05-18-maps-hw1 TJLee 2020-05-20 library(maptools) ## Loading required package: sp ## Checking rgeos availability: TRUE library(ggmap) ## Loading required package: ggplot2 ## Google's Terms of Service: https://cloud.google.com/maps-platform/terms/. ## Please cite ggmap if you use it! See citation("ggmap") for details. library(sf) ## Linking to GE...

49 sym R (2780 sym/21 pcs) 1 img 2 tbl

Document

22.05.2020

05-18-In-class exercises-3 TJLee 2020-05-22 db_AE <- as.Date("2014/5/20") dd_AE <- as.Date("2114/5/20") bDays <- seq(from=db_AE, to=dd_AE, by="years") data <-data.frame(table(weekdays(bDays))) library(tidyverse) ## -- Attaching packages ----------------- tidyverse 1.3.0 -- ## √ ggplot2 3.3.0 √ purrr 0.3.3 ## √ tibble 2.1.3 ...

54 sym R (795 sym/5 pcs) 1 img

Document

18.10.2020

1 load and see #load package library(lme4) ## Loading required package: Matrix 18 subjects (3hrs sleep) 10 observations on each, p64 of bates the “new” random effects (vs nlme) see Bates book 2010 sleep deprivation 3hrs/night truckers #input data data(sleepstudy, package="lme4") #dimension dim(sleepstudy) ## [1] 180 3 #see it head(sl...

542 sym R (5086 sym/38 pcs) 3 img

Document

18.10.2020

The data consist of weight gains of 68 Asian children in a British community. Measurements of weight were recorded for children on up to five occasions visiting a clinic. The ages at which the measurements were taken are roughly to target examination dates of 6 weeks, then 8, 12, 27 months. 1 load data pacman::p_load(tidyverse, afex, segmented, ...

1164 sym R (7991 sym/30 pcs) 4 img

Document

12.10.2020

1 Hw1 1.1 load data and see it pacman::p_load(mlmRev, tidyverse, lme4, nlme) dta<-read.table("D:/sheu/iq_language.txt", h=T) head(dta) ## School Pupil IQ Language Group_size IQ_c School_mean Group_mean ## 1 1 17001 15.0 46 29 3.1659379 -1.51406 5.9 ## 2 1 17002 14.5 45 29 2.6659379 ...

800 sym R (7695 sym/29 pcs) 4 img

Document

03.10.2020

1 load data pacman::p_load(tidyverse, lme4) # input data dta <- read.table("finger_ridges.txt", header = T) 2 change pair variable to factor type # coerce pair variable to factor type dta$Pair <- factor(dta$Pair) # show first 6 lines head(dta) ## Pair Twin_1 Twin_2 ## 1 1 71 71 ## 2 2 79 82 ## 3 3 105 9...

207 sym R (2963 sym/18 pcs) 1 img