Last active
April 9, 2017 16:39
-
-
Save wush978/957d8bee92f78f6c0aead949609f921d to your computer and use it in GitHub Desktop.
透過80 port 來安裝R語言翻轉教室
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
local({ | |
check_package <- function(pkg) { | |
if (!suppressWarnings(suppressMessages(require(pkg, character.only = TRUE)))) { | |
install.packages(pkg, repos = "http://wush978.github.io/R") | |
} | |
} | |
lapply(c("rappdirs", "bitops", "curl"), check_package) | |
utils::install.packages("swirl", repos = "http://wush978.github.io/R") | |
}) | |
library(swirl) | |
library(curl) | |
library(methods) | |
# Sorry, server.datascienceandr.org is down and will not recover | |
# install_course_url("http://server.datascienceandr.org/swirl/DataScienceAndR.zip") | |
download.file("https://github.com/wush978/DataScienceAndR/archive/course.zip", tmp.file <- tempfile(fileext = ".zip")) | |
unzip(tmp.file, exdir = tempdir()) | |
file.rename(file.path(tempdir(), "DataScienceAndR-course"), file.path(tempdir(), "DataScienceAndR")) | |
swirl::install_course_directory(file.path(tempdir(), "DataScienceAndR")) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
r