swirldev / swirl_courses

:mortar_board: A collection of interactive courses for the swirl R package.
http://swirlstats.com
Other
4.32k stars 7.24k forks source link

include progress indicator for course install / takes very long, appears to hang #65

Open maxheld83 opened 10 years ago

maxheld83 commented 10 years ago

Whenever I select something from the below, R appears to hang, I get a blank like with a cursor (no prompt), and RStudio tells me that the R Session is busy.

There is no progress indicator.

This might easily be misunderstood as a hang (I did). The process appears to take minutes on a 6Mbit down line.

I got: OS X 10.10, R 3.1.2, RStudio 0.98.1079.

| To begin, you must install a course. I can install a course for you from the internet, or I can send you to a web page
| (https://github.com/swirldev/swirl_courses) which will provide course options and directions for installing courses
| yourself. (If you are not connected to the internet, type 0 to exit.)

1: R Programming: The basics of programming in R
2: Regression Models: The basics of regression modeling in R
3: Don't install anything for me. I'll do it myself.

Selection: 1

this is the part that takes forever, with no indication of progress

| Course installed successfully!

| Please choose a course, or type 0 to exit swirl.

1: R Programming
2: Take me to the swirl course repository!

Yipeeh!

Also, fantastic work.

WilCrofter commented 10 years ago

@maxheld83, thanks for the tip. My guess is that download speed is governed by the current load on github's server. My test installations from github can vary from nearly instantaneous to seriously lagging.

A progress bar would be a nice feature, though implementation is not straightforward. The main complication, of course, is that R is single threaded, so while one function is in progress, R can't do anything else until that function returns. So, unless the download function itself provides for a progress bar, we're stuck. Currently, httr::GET is used for the purpose, and it does not.

Closer to the metal, but more complicated to use, RCurl::curlPerform supports a progressfunction argument which looks as if it might do the trick.

seankross commented 10 years ago

@maxheld83 You could also download the zip files of the swirl courses directory (most browsers have a download progress bar) and then install a course with the command: install_course_zip("~/Downloads/swirl_courses-master.zip", multi=TRUE, which_course="R Programming")

maxheld83 commented 10 years ago

uh that makes sense, thanks for the explanation @WilCrofter, @seankross . Progress indicator probably makes no sense, should've thought about the fact that it's hard to do.

Anyway, I am happy as can be with Swirl, just thought this might throw off newbies (like myself). Maybe just add a little notice before the download that

"this might take a while and R might appear unresponsive during the download"

Or sth like that?

philest commented 9 years ago

This threw me off, too-- a notice would help!

seankross commented 9 years ago

A progress bar is currently in the development version of swirl. You can download the development version with:

install.packages("devtools")
devtools::install_github("swirldev/swirl")
library(swirl)
swirl()
jessebikman commented 9 years ago

Ran into this problem just now. This is a UX issue that could throw off prospective adherents of the language given the target audience. Would be a great feature to add if it's already in the development version and working well!

seankross commented 9 years ago

There is a progress bar in the development version of swirl, and courses will be much smaller files in the development version of swirl.