Skip to content

Instantly share code, notes, and snippets.

@wush978
Last active April 9, 2017 16:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wush978/957d8bee92f78f6c0aead949609f921d to your computer and use it in GitHub Desktop.
Save wush978/957d8bee92f78f6c0aead949609f921d to your computer and use it in GitHub Desktop.
透過80 port 來安裝R語言翻轉教室
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"))
@ChenYuHsin
Copy link

123

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment