Q1
dta <- read.table("tw_to_us.txt", h = F) %>%
rename(Numbers = "V1") %>%
mutate(Year = c(seq(1950, 1990, by = 5), 1991:2004))
ggplot(dta,aes(Year, Numbers)) + geom_line(lwd = rel(1.2)) +
labs(x="Year",y="Number of students") +
geom_vline(xintercept = c(1990), linetype = "dotted")

Q2
library(leaflet)
m <- leaflet() %>%
addTiles() %>%
addMarkers(lng = 120.196958, lat = 22.998650, popup = "黃火木舊台味冰店")%>%
addMarkers(lng = 120.197444, lat = 22.993833, popup = "O M HUT")%>%
addMarkers(lng = 120.201437, lat = 22.998406, popup = "JC CLUB 台南店")
m
Q3
library(rvest)
#Forrest Gump
fL <- "https://www.imdb.com/title/tt0109830/?ref_=tt_rec_tt"
film_ts <- read_html(fL)
#rating
film_ts %>%
html_node("strong span") %>%
html_text() %>%
as.numeric()
[1] 8.8
#cast
film_ts %>%
html_nodes("#titleCast .itemprop span") %>%
html_text()
[1] "Tom Hanks" "Rebecca Williams"
[3] "Sally Field" "Michael Conner Humphreys"
[5] "Harold G. Herthum" "George Kelly"
[7] "Bob Penny" "John Randall"
[9] "Sam Anderson" "Margo Moorer"
[11] "Ione M. Telech" "Christine Seabrook"
[13] "John Worsham" "Peter Dobson"
[15] "Siobhan Fallon Hogan"