swirldev / swirl_courses Goto Github PK
View Code? Open in Web Editor NEW:mortar_board: A collection of interactive courses for the swirl R package.
Home Page: http://swirlstats.com
License: Other
:mortar_board: A collection of interactive courses for the swirl R package.
Home Page: http://swirlstats.com
License: Other
Hi,
I am using Mac OS and R Studio, but whenever i try to install this courses manually from the zip file I am getting the following error:
Error in unzip(path, list = TRUE) :
zip file '/Users/Dibs/Downloads/swirl_courses-master.zip' cannot be opened
Request any suggestion
I was just working through the lesson and came across this question:
Output: To see another example of how this vector 'recycling' works, try adding
c(1, 2, 3, 4) and c(0, 10). Don't worry about saving the result in a new variable.
Wanting to save keystrokes on a whim, I typed c(1:4) + c(0, 10). Even though the result of this is equivalent to simply copying from the question directly, the course did not recognize it as correct.
Is there any reason for this to be so, such as it being impossible to have more than one answer to a question in swirl? If that is the case, would it not make more sense to store the intended output as the answer to the question when the output is what the question regards?
I apologize for my unfamiliarity with YAML, but could storing the result as correct be achieved by using the AnswerTests field, somehow?
In the 'Mathematical Biostatistics Boot Camp Two Sample t-test'
I get the following errors after inputting skip() at the following question:
Use the 'pt' function to compute the probability of getting a t-statistic that's greater than the value of the one we got and store this quanitity to a new variable called 'pVal1'. If you can't figure this one out on your own, then the hint will help you.
skip()
Error in pt(tStat, df = myDF, lower.tail = FALSE) :
unused argument (lower.tail = FALSE)
Leaving swirl now. Type swirl() to resume.
Originally my answer was
pVal1 <- pt(tStat, df = myDF, lower.tail=FALSE)
and i got the following error
Error in pt(tStat, df = myDF, lower.tail = FALSE) :
unused argument (lower.tail = FALSE)
Am i doing something wrong here? It is possible that my answer is just wrong - however that does not explain the error i get when i try to
skip()
Any advice or comments would be great! Thanks
R automatically quits on Data Analysis, Central Tendency Lesson. Margins need to be fixed.
Message:
| Here is a diagram showing the relationship between a population and a sample.
Error in plot.new() : figure margins too large
(Nick, I'd not seen the issues section here. I'll use this to notify you from now on.)
NOTE: this may be solely be due to my locale being "English_United States.1252" rather than "en_US.UTF-8". However, my run through "Lesson 4: Dates and Times with lubridate" didn't throw off any warnings or errors until the second to last question, here:
| Now use as.period(how_long) to see how long it's been.
> as.period(how_long)
[1] "6y 3m 11d 21H 24M 55.1787569522858S"
Warning message:
In Ops.factor(left, right) : - not meaningful for factors
| Excellent job!
|==========<snip>=========================================== | 96%
| This is where things get a little tricky. Because of things like leap years, leap seconds, ...
The next (last) question on stopwatch() didn't throw a warning or error.
However, the same warning appears on exiting Swirl, as shown here:
1: Getting and Cleaning Data
2: Take me to the swirl course repository!
Selection: 2
| OK. I'm opening the swirl courses web page in your browser.
| Leaving swirl now. Type swirl() to resume.
warning messages from top-level task callback 'mini'
Warning message:
In Ops.factor(left, right) : - not meaningful for factors
I recognize this may be a very minor matter but, as its appearence may drive a few dozen (hundred?) extra questions over the next few years, it may be worth your looking into it.
Thanks, as always, for a great tool.
Should course authors add content to swirl_courses through a pull request, or through some other method?
Hi, is there a list of potential swirl courses in this directory? I can't find one, only the instructions on how to install a course and a list of the "popular" courses. How can I see which courses are available?
Thanks!
Kate
"""If your dplyr version is not at least 2.0, then you should hit the Esc key
| now, reinstall dplyr, then resume this lesson where you left"""
There's only a version 0.2 of dplyr, not 2.0
http://cran.r-project.org/web/packages/dplyr/index.html
Hey all,
I'm still new to this whole world so first thanks for all the work getting this created! I love the concept and am excited to get started. I'll try and manually install this course, but i wanted to make sure someone was aware that it's not available via Swirl's automated installation. Below is the message i got after following the prompts.
| 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
| Sorry, but I'm unable to fetch <U+0091>R Programming: The basics of programming in >R<U+0092> right now. Are you sure you have an
| internet connection? If so, would you like to try again or visit the course repository for instructions on >how to install
| a course manually? Type 0 to exit.>
I keep getting an error when using rm() in a lesson. A small reproducible example follows. Create a lesson yaml that looks like:
Using testit(), I get:
set_lesson("~/Desktop/projects/swirl_courses/Bug/Bug/lesson.yaml")
This lesson is located at C:\Users\dkane\Desktop\projects\swirl_courses\Bug\Bug\lesson.yaml
If the lesson file doesn't open automatically, you can open it now to begin editing...
testit()
| Course installed successfully!
| | 0%
| Assign 9 to x using x <- 9.
x <- 9
| Perseverance, that's the answer.
|===================================================================================| 100%
| Remove x from the workspace.
rm(x)
| Perseverance, that's the answer.
Error in get(nm, globalenv()) : object 'x' not found
| Leaving swirl now. Type swirl() to resume.
Any ideas? I thought that this was working two weeks ago when I initially sent in a pull request with a new lesson for R Programming. But it does not seem to work now.
The word equivalent is misspelled.
"That's exactly what we've done in this script. The result is equivilent, but the code is much less readable and some of the arguments are far away from the function to which they belong. Again, just try to understand what is going on | here, then submit() when you are ready to see a better solution."
Hi, in the introduction, at 30% when will be displayed the regression line I got this message:
Error in lm(jitter(child, 4) ~ parent, galton) : unused argument (galton)
| Leaving swirl now. Type swirl() to resume.
Thank you for your time.
Petronio
PS - I´m using RStudio 0.98.507 | Windows 7
I selected regression in starting and now I am unable to go to R programming. main() takes me to main page but it only give Regression or taking to SWIRL website option.
Want to complete my R assignment.
Best,
Jain
for those that have access to coursera MOOC ... , here's the issue to solve ... I'll post a fix in a second if this is acceptable to you. https://class.coursera.org/getdata-016/forum/thread?thread_id=275#post-1116
I have been using the CLI (through ssh) to work through the various courses in swirl and as such do not get to see any of the boxplots. In this instance I would like to skip certain questions that pertain to the features of those graphs - I cannot find a way to do this. Neither the skip() or nxt() functions will escape when there is a "ANSWER:" prompt. Universal support of these functions would be valuable for people who use this configuration.
Going through R Programming to test robust omnitest, I noticed that lapply
rather should probably replace sapply
in the answer below. The next question uses sapply
and the point is to show that sapply
reverts to lapply
when it can't simplify.
- Class: cmd_question
Output: "Since unique_vals is a list, you can use what you've learned to determine the length of each element of unique_vals (i.e. the number of unique values for each variable). Simplify the result, if possible. Hint: Apply the length() function to each element of unique_vals."
CorrectAnswer: sapply(unique_vals, length)
AnswerTests: omnitest(correctExpr='sapply(unique_vals, length)')
Hint: Apply the length() function to each element of the unique_vals list using sapply(). Remember, no parentheses after the name of the function you are applying (i.e. length).
Hi!
I'll be writing my Bachelor thesis in statistics this fall and I use the Coursera course (regression models) and this swirl to get back on track with R-programing. The Swirl idea is awesome! One thing, though, that would make it even better would be if in every task in the Swirl a number would be displayed to the corresponding slide from Coursera.
Thanks for a great interactive learning platform!
Filip
I'm just a beginner, but I'm also lazy, which means I don't like repeatedly typing unnecessary characters. I'm also possibly OCD-afflicted, but the fact that the "-" doesn't bisect the "<" in my font bothers me. Anyway, I prefer to type "=" instead of "<-", but while this (as far as I know) is treated by R as equivalent, in swirl I get "You almost got it" and similar encouragement to do better. I'd prefer it if swirl treated me like the unsung genius that I am, instead of like a bumbler.
Does everyone find my convention of using backticks (``) to denote R expressions in swirl content to be helpful or distracting and/or confusing? It's trivial for me to remove them from the R Programming course if you think I should. Please let me know ASAP.
P.S. -- I've added 3 lessons to R Programming in the last couple of days and I'd greatly appreciate any feedback before they go live on Coursera.
I've added 5 new lessons to R programming and a new course called Getting and Cleaning Data (4 lessons so far). I'd love to hear what everyone thinks if you have some time to work through them.
I'm very open to feedback, as I've tried some new approaches, particularly with the script-based questions in Getting and Cleaning Data.
| Please choose a course, or type 0 to exit swirl.
1: Overview of Statistics
2: R Programming
3: Take me to the swirl course repository!
Selection: 1
| Please choose a lesson, or type 0 to return to course menu.
1: dependson.txt
[...]
Selection: 1
Error in file(con, "r") : invalid 'description' argument
| Leaving swirl now. Type swirl() to resume.
At row 145, ' it''s ' should be ' its '.
Thanks,
Margherita
Thank you for an excellent collection of lessons. I am new to R (and GitHub) and having been working through all the Swirl lessons. Very enjoyable and informative. The only insurmountable issue I have encountered was near the end of the last lesson
The Statistical_Inference / Resampling lesson keeps repeating
"Nice try, but that's not exactly what I was hoping for. Try again. Or, type info() for more options."
"Type perms <- sapply(1 : 10000, function(i) testStat(BCcounts, sample(group))) at the command prompt."
This happens no matter how I try to type the command (even if I cut/paste) the prompt text.
I found the offending point at line 303-307 on https://github.com/swirldev/swirl_courses/blob/master/Statistical_Inference/Resampling/lesson
which looks correct but still repeats in RStudio.
I look forward to additional courses.
!(5==7)
is not recognized as a correct answer while !5==7
is. Please allow for parantheses as well.
|========================== | 27%
| In order to negate boolean expressions you can use the NOT operator. An exclamation point `!` will
| cause !TRUE (say: not true) to evaluate to FALSE and !FALSE (say: not false) to evaluate to TRUE. Try
| using the NOT operator and the equals operator to find the opposite of whether 5 is equal to 7.
> !(5==7)
[1] TRUE
| That's not exactly what I'm looking for. Try again. Or, type info() for more options.
| This expression may be a little tricky, so think about negating the expression 5 == 7 (all you need is
| an exclamation point in front).
> !5==7
[1] TRUE
| That's the answer I was looking for.
In the Open Intro course, no stem-and-leaf-plot is displayed for me (around 57% of first lecture (if there are more than one)).
I'm using R 3.1.0 x64 in RStudio 0.98.507 under Win 8.1 and installed the Open Intro package yesterday.
Hi There,
I am running Version 0.98.1049 and cannot run any coursed installed from swirl. I am getting the following error.
Please choose a course, or type 0 to exit swirl.
1: R Programming
2: swirldev-swirl courses-0abced2
3: Vectors
4: Take me to the swirl course repository!
Selection: 3
| Please choose a lesson, or type 0 to return to course menu.
1: customTests.R
2: lesson.yaml
Selection: 2
Error in file(con, "r") : invalid 'description' argument
| Leaving swirl now. Type swirl() to resume.
I have tried installing and re-installing, still get the same issue.
I am using R version 3.1.1
Regards
Tez
The character font should be larger. I had difficultly, sometimes, in reading the material. Also I think it would present better (easier to read and absorb) if you forced your sentences to be no longer that 40 characters in length. But the larger font is the main issue I had in reading your material.
Typo in the vapply/tapply lesson. Should be 'countries' not 'counties'
I 88%
I what is the median population (in millions) for counties
I without the color red on their flag?
Perhaps you are trying to enforce a good habit,
But I am consistently caught using "=" in my answers,
Instead of "<-",
Although I believe they are functionally equivalent.
This is introduced in Manipulating_Data_with_dplyr lesson but the help page no longer exists
Ref: http://stackoverflow.com/questions/26487908/manip-no-longer-works-in-the-dplyr-0-3
Within the Data Analysis: Central Tendency course, when prompted to enter cars into the R command prompt, swirl seems to disregard this as a correct answer -- even skip() results in an error message.
| You are quite good my friend!
|========================== | 48%
| Which of the following terms are of most importance when
| describing the central tendency of a data set?
1: mode, median, mean
2: statistics, population, mode
3: median, mode, range
4: population, sample, representative
Selection: 1
| You're the best!
|=========================== | 52%
| To illustrate these concepts, we will now look at a real
| dataset from the 'openintro' R package, which has already
| been loaded for you. Type 'cars' and press Enter to see the
| dataset we'll be working with.
>
> cars
type price mpgCity driveTrain passengers weight
1 small 15.9 25 front 5 2705
2 midsize 33.9 18 front 5 3560
3 midsize 37.7 19 front 6 3405
4 midsize 30.0 22 rear 4 3640
5 midsize 15.7 22 front 6 2880
6 large 20.8 19 front 6 3470
7 large 23.7 16 rear 6 4105
8 midsize 26.3 19 front 5 3495
9 large 34.7 16 front 6 3620
10 midsize 40.1 16 front 5 3935
11 midsize 15.9 21 front 6 3195
12 large 18.8 17 rear 6 3910
13 large 18.4 20 front 6 3515
14 large 29.5 20 front 6 3570
15 small 9.2 29 front 5 2270
16 small 11.3 23 front 5 2670
17 midsize 15.6 21 front 6 3080
18 small 12.2 29 front 5 2295
19 large 19.3 20 front 6 3490
20 small 7.4 31 front 4 1845
21 small 10.1 23 front 5 2530
22 midsize 20.2 21 front 5 3325
23 large 20.9 18 rear 6 3950
24 small 8.4 46 front 4 1695
25 small 12.1 42 front 4 2350
26 small 8.0 29 front 5 2345
27 small 10.0 22 front 5 2620
28 midsize 13.9 20 front 5 2885
29 midsize 47.9 17 rear 5 4000
30 midsize 28.0 18 front 5 3510
31 midsize 35.2 18 rear 4 3515
32 midsize 34.3 17 front 6 3695
33 large 36.1 18 rear 6 4055
34 small 8.3 29 front 4 2325
35 small 11.6 28 front 5 2440
36 midsize 61.9 19 rear 5 3525
37 midsize 14.9 19 rear 5 3610
38 small 10.3 29 front 5 2295
39 midsize 26.1 18 front 5 3730
40 small 11.8 29 front 5 2545
41 midsize 21.5 21 front 5 3200
42 midsize 16.3 23 front 5 2890
43 large 20.7 19 front 6 3470
44 small 9.0 31 front 4 2350
45 midsize 18.5 19 front 5 3450
46 large 24.4 19 front 6 3495
47 small 11.1 28 front 5 2495
48 small 8.4 33 4WD 4 2045
49 small 10.9 25 4WD 5 2490
50 small 8.6 39 front 4 1965
51 small 9.8 32 front 5 2055
52 midsize 18.2 22 front 5 3030
53 small 9.1 25 front 4 2240
54 midsize 26.7 20 front 5 3245
| Not quite right, but keep trying. Or, type info() for more
| options.
| Type 'cars' and press Enter. Do not use quotes, spaces, or
| uppercase letters.
> cars
type price mpgCity driveTrain passengers weight
1 small 15.9 25 front 5 2705
2 midsize 33.9 18 front 5 3560
3 midsize 37.7 19 front 6 3405
4 midsize 30.0 22 rear 4 3640
5 midsize 15.7 22 front 6 2880
6 large 20.8 19 front 6 3470
7 large 23.7 16 rear 6 4105
8 midsize 26.3 19 front 5 3495
9 large 34.7 16 front 6 3620
10 midsize 40.1 16 front 5 3935
11 midsize 15.9 21 front 6 3195
12 large 18.8 17 rear 6 3910
13 large 18.4 20 front 6 3515
14 large 29.5 20 front 6 3570
15 small 9.2 29 front 5 2270
16 small 11.3 23 front 5 2670
17 midsize 15.6 21 front 6 3080
18 small 12.2 29 front 5 2295
19 large 19.3 20 front 6 3490
20 small 7.4 31 front 4 1845
21 small 10.1 23 front 5 2530
22 midsize 20.2 21 front 5 3325
23 large 20.9 18 rear 6 3950
24 small 8.4 46 front 4 1695
25 small 12.1 42 front 4 2350
26 small 8.0 29 front 5 2345
27 small 10.0 22 front 5 2620
28 midsize 13.9 20 front 5 2885
29 midsize 47.9 17 rear 5 4000
30 midsize 28.0 18 front 5 3510
31 midsize 35.2 18 rear 4 3515
32 midsize 34.3 17 front 6 3695
33 large 36.1 18 rear 6 4055
34 small 8.3 29 front 4 2325
35 small 11.6 28 front 5 2440
36 midsize 61.9 19 rear 5 3525
37 midsize 14.9 19 rear 5 3610
38 small 10.3 29 front 5 2295
39 midsize 26.1 18 front 5 3730
40 small 11.8 29 front 5 2545
41 midsize 21.5 21 front 5 3200
42 midsize 16.3 23 front 5 2890
43 large 20.7 19 front 6 3470
44 small 9.0 31 front 4 2350
45 midsize 18.5 19 front 5 3450
46 large 24.4 19 front 6 3495
47 small 11.1 28 front 5 2495
48 small 8.4 33 4WD 4 2045
49 small 10.9 25 4WD 5 2490
50 small 8.6 39 front 4 1965
51 small 9.8 32 front 5 2055
52 midsize 18.2 22 front 5 3030
53 small 9.1 25 front 4 2240
54 midsize 26.7 20 front 5 3245
| Give it another try. Or, type info() for more options.
| Type 'cars' and press Enter. Do not use quotes, spaces, or
| uppercase letters.
> skip()
| I've entered the correct answer for you.
| Give it another try. Or, type info() for more options.
| Type 'cars' and press Enter. Do not use quotes, spaces, or
| uppercase letters.
>
If user's locale not English (?US), examples don't work as expected. Need to warn I guess. I raised an issue on lubridate too which I noticed as a result: [https://github.com/tidyverse/lubridate/issues/255]
Hi, thanks for an excelent way to learn R.
in the Getting and Cleaning Data course, near the end of Manipulating Data with dplyr,
I was introduced to summarize(). Being used to using UK spelling, i used summarise() which gave the correct output, but swirl did not acnowleage this and asked me to try again.
@WilCrofter -- I know we've got a dependson.txt
for the first Regression lesson:
https://github.com/swirldev/swirl_courses/blob/master/Regression_Models/Introduction/dependson.txt
Would you mind adding one for each of the later lessons that has package dependencies? I expect that your Regression course will be getting more and more attention, and people will get namespace errors if they don't have the required packages installed.
Also, please feel free to add it to the "Popular Courses" list on the readme if you feel pretty good about what's there. I'm very excited about it.
Lesson 2 'Residuals' of the Regression Models swirl course reads:
This lesson corresponds to Regression_Models/01_02_linearRegression.
,
refering to https://github.com/DataScienceSpecialization/courses/tree/master/07_RegressionModels/01_02_linearRegression
,
which is a page that doesn't exist.
Possibly it should be 01_02_notation
or another section.
The lesson also refers to equations "in the slides" for the intercept and slope which are difficult to identify; they don't seem to be in 01_02_notation
.
In the second swirl class of Getting_and_Cleaning_Data (Grouping_and_Chaining_with_dplyr) at the 47% mark, you are told to enter top_counts
and you then see the comment:
| Hey, that's the first time we've seen more than the first 10 rows of our data! By default, if the
| dataset you're working with has more than 100 rows, dplyr will only print the first 10. Otherwise, it
| will print all rows, since it's not as overwhelming.
As of a commit to dplyr from October 2014, that is no longer true:
The threshold is now 20, not 100. This changes the text of this answer as well as the next text:
| In this case, there are 61 packages in our top 1%, so dplyr has printed all of them. If we only want
| to see the first 20, we can use the head function like so: head(top_counts, 20).
and finally, this also impacts the text at 55%:
| ...And if you keep on going, you'll see swirl at number 43, with 820 total downloads. Sweet!
as you no longer see the 43rd entry in the output. The same is true for the output at 68%:
| Now Rcpp is in the lead, followed by stringr, digest, plyr, and ggplot2. swirl moved up a few spaces
| to number 40, with 698 unique downloads. Nice!
It may impact some of the thresholds chosen in the R code, such as countries > 60, in following examples, where you now only see the top 10 of the 46 results, if the intention was that you would see all results in this output.
Again, the text at 87% refers to an entry that is no longer visible:
| It looks like Rcpp is on top with downloads from 84 different countries, followed by digest, stringr,
| plyr, and ggplot2. swirl jumped up the rankings again, this time to 27th.
Hi Swirl developers,
I just finished the Data Analysis / Data Visualization lesson and it says there is a "next lesson" to continue learning. However, it's unclear what lesson this is referring to! Does it exist?
Arthur
course name: R Programming
lesson name: Simulation
text containing the typo: Equivilently
This occurs at about 56%
Multivar examples 3: (note new Omnitest will fix this one)
summary(lm(Fertility ~ Agriculture, data = swiss))
# vs
summary(lm(Fertility ~ Agriculture, swiss))
Multivar examples 2:
summary(fit)$coefficient[,1]
# vs
summary(fit)$coef[,1]
Multivar examples 3:
colnames(hunger)
# is not considered correct while
names(hunger)
See this thread in the Swirl Discussion group.
NOTE: I've been unable to reproduce the problem.
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.
It would be great to have a course on functions. I've attempted the R Programming course on Coursera twice, but I just have trouble making the leap from the videos to the first assignment. It would be excellent to have optional assignments or a swirl module to work through these much more in depth.
It seems backticks have been an issue for some people using non-English keyboards. We should allow students to use single quotes in addition to backticks, since their functionality seems to be identical in all standard use cases. Official docs at ?Quotes
or ?backtick
.
In particular, we ask the user to look up help for the colon operator beginning around line 51 of Sequences of Numbers in the R Programming course. In addition to the answer currently accepted, we should accept ?':'
. I think we did something similar (accepting multiple answers) in another lesson recently.
@WilCrofter If you wouldn't mind adding the custom test (in a pull request), I can update the question wording (in that same pull request) to accommodate both responses.
Requested in issue #36
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.