Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

could not load dplyr #621

Open
wants to merge 122 commits into
base: swirl_out
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
122 commits
Select commit Hold shift + click to select a range
d5d1d63
fix troublesome links to swirl_courses page and increment version to …
ncarchedi Aug 15, 2014
4a9592f
update readme
ncarchedi Aug 19, 2014
1b4f14b
update readme
ncarchedi Aug 19, 2014
13e32d3
fix bug #198
ncarchedi Aug 26, 2014
26bf109
increment version to 2.2.16
ncarchedi Aug 26, 2014
5e8dc40
Incorporate rmatch_calls in omnitest.
WilCrofter Sep 21, 2014
034834a
multiple minor bug fixes
WilCrofter Sep 24, 2014
ce47b54
more minor bug fixes
WilCrofter Sep 24, 2014
768b5d9
added function to delete user progress
seankross Sep 26, 2014
0ee4d29
added delete_progress to API
seankross Sep 26, 2014
28077b9
bug fix
WilCrofter Sep 28, 2014
5c5294e
Merge pull request #205 from swirldev/f.robust_omni_1
ncarchedi Oct 5, 2014
84544ae
Allow the use of partner.coursera.org websites for Coursera submissio…
Oct 9, 2014
10dd09b
Merge pull request #209 from dgrtwo/master
WilCrofter Oct 11, 2014
e46eeab
Update news to reflect 2 recent merges.
WilCrofter Oct 11, 2014
d2d7cb1
Merge remote-tracking branch 'origin/master' into deleteProgress
seankross Nov 2, 2014
95a9016
added check for valid user name in deleteProgress
seankross Nov 2, 2014
5f4bfab
correcting bug in omnitest
WilCrofter Nov 5, 2014
f368217
Merge pull request #218 from swirldev/bug.omnitest.1
ncarchedi Nov 6, 2014
0141363
Merge branch 'deleteProgress'
ncarchedi Nov 6, 2014
4b27c05
Update DESCRIPTION and NEWS to reflect bug fixes and other additions
ncarchedi Nov 6, 2014
2246f38
remove old cran comment
ncarchedi Nov 13, 2014
d850938
Added function uninstall_all_courses
seankross Nov 14, 2014
a8e64f1
Merge pull request #223 from swirldev/uninstall_all_courses
ncarchedi Nov 14, 2014
e1796bc
fixed bug in uninstall_all_courses
seankross Nov 15, 2014
ee14f20
Merge pull request #224 from swirldev/uninstall_all_courses
seankross Nov 15, 2014
0c007d4
Force UTF-8 encoding of message in swirl_out to solve WINDOWS-1252, a…
WilCrofter Nov 19, 2014
e1370b8
Merge pull request #229 from swirldev/w1252
ncarchedi Nov 20, 2014
f29440f
fix typo in omnitest
WilCrofter Dec 8, 2014
2b64deb
Merge pull request #236 from swirldev/fix_omnitest_typo
ncarchedi Dec 9, 2014
1b25c75
Increment version (bugfix) and add news item.
WilCrofter Dec 9, 2014
690c765
Fix swirl_courses/issue#95
WilCrofter Dec 28, 2014
42566bd
added bitbucket mirroring for install_from_swirl
seankross Jan 3, 2015
c335145
Merge pull request #242 from swirldev/install_from_swirl-source
ncarchedi Jan 3, 2015
626b4cf
update NEWS for 2.2.21
ncarchedi Jan 4, 2015
22ba715
remove period from DESCRIPTION title, per prof ripley's request
ncarchedi Jan 4, 2015
ec5dc2b
Add print statement in skip() to output the command return value
alex-dranoel Jan 5, 2015
b93075e
Use withInvisible() to track visibility of expression
alex-dranoel Jan 11, 2015
9506605
Merge pull request #246 from alex-dranoel/print-in-skip
WilCrofter Jan 13, 2015
91d19aa
first functional version
filipsch Mar 9, 2015
a029af9
generic install location
filipsch Mar 10, 2015
6206d0b
give user time to read feedback
filipsch Mar 10, 2015
cf3e4ba
typo fix
filipsch Mar 10, 2015
be4fcd2
row sent as well + bugfix
filipsch Mar 10, 2015
4832ab6
fix in fast forward
filipsch Mar 11, 2015
3c4f14d
change post arch, update documentation
filipsch Mar 11, 2015
56845c4
add API for multiple choice, fix in user_path
filipsch Mar 17, 2015
7e59b72
remove datacamp related functions from swirl as much as possible
filipsch Mar 17, 2015
02aa68a
more generic way of specifying arguments
filipsch Mar 18, 2015
6fa40d0
add init support
filipsch Mar 18, 2015
d0a12f8
fix for MCE
filipsch Mar 19, 2015
d6f3ee2
typo fix
filipsch Mar 20, 2015
7e2a179
formatting
filipsch Mar 20, 2015
01c1d36
add restart, refactor resume, add skipped info
filipsch Mar 30, 2015
84a368e
added rappdirs
seankross Apr 2, 2015
ae50ae5
Merge branch 'Data-Camp-master'
seankross Apr 2, 2015
4b1d555
added swirl options
seankross Apr 6, 2015
fecfa4d
added swirl options docs
seankross Apr 6, 2015
fd1e234
Merge pull request #1 from seankross/master
filipsch Apr 6, 2015
db733fb
Merge pull request #277 from Data-Camp/master
ncarchedi Apr 7, 2015
82ba231
Bump version to 2.3.0 and update DESCRIPTION and NEWS files
ncarchedi Apr 7, 2015
cb49c56
Update README.md
seankross Apr 24, 2015
044ec7e
Update README.md
seankross Apr 24, 2015
cfeffc9
Progress bar. If file size is known, you get a progress bar, Otherwis…
shetaa Jun 8, 2015
7599eca
Merge branch 'shetaa-master' into progress-bar
seankross Jun 9, 2015
8d64f91
added progress bar
seankross Jun 9, 2015
70d1f9f
fix typo
shetaa Jun 10, 2015
c02f370
Merge branch 'shetaa-master' into progress-bar
seankross Jun 10, 2015
bd65809
Merge pull request #313 from shetaa/master
seankross Jun 10, 2015
1ade337
Merge pull request #315 from swirldev/progress-bar
seankross Jun 10, 2015
317d7c8
Added slack to README
seankross Jun 16, 2015
171d4b9
Update README.md
seankross Aug 19, 2015
bde8604
added install_course
seankross Dec 17, 2015
fedabe3
updated langauge support
seankross Jan 29, 2016
82d0479
added logging
seankross Feb 10, 2016
dc73213
wrap the parsed object with encoding
wush978 May 20, 2015
adfacf8
debug: assign value to non-character option
wush978 Jun 8, 2015
e4b55b5
resolved actions.R conflict
wush978 Oct 19, 2015
54cf6c5
fixed install_from_swirl issue
seankross Feb 10, 2016
b7505ce
added translations to menu.R
seankross Feb 10, 2016
2ae599a
updated languages
seankross Feb 12, 2016
9fb3c2d
fixed issue with uninstall_all_courses
seankross Feb 17, 2016
0e0ad5d
added docs for swirl_options
seankross Feb 17, 2016
f36ea38
added final line to suggested courses
seankross Feb 17, 2016
f840236
Update suggested_courses.yaml
seankross Feb 17, 2016
1b9bbea
added logging
seankross Feb 18, 2016
11bcdb5
Merge branch 'dev' of https://github.com/swirldev/swirl into dev
seankross Feb 18, 2016
003c460
added skip detection
seankross Feb 18, 2016
732786a
fixed install_course bug
seankross Feb 24, 2016
09a1a94
added force arg to install_course
seankross Mar 15, 2016
375b432
swirl 2.4.0 :tada:
seankross Mar 15, 2016
8a49bb7
changed encoding test
seankross Mar 15, 2016
2ad13dc
use stringi in encoding test
seankross Mar 16, 2016
79faa3f
attempt to fix encoding issues
seankross Mar 16, 2016
15bde6f
fixed encoding issues for manifest
seankross Mar 16, 2016
76c57bb
added language parameter and made manifest more robust
seankross Mar 21, 2016
2b197a4
latest language data
seankross Mar 21, 2016
424301f
added cran comments and fixed typo
seankross Mar 21, 2016
3221082
fixed a typo
seankross Mar 22, 2016
50cf8f6
Merge pull request #435 from swirldev/dev
seankross Mar 25, 2016
fcf65c1
fixed expectation issue
seankross Apr 8, 2016
eb9afb5
added testthat_legacy
seankross Apr 11, 2016
248d285
added revdep
seankross Apr 14, 2016
06dd821
Merge pull request #453 from swirldev/dev
seankross Apr 15, 2016
d94dcc5
Delete .Rapp.history
seankross Apr 15, 2016
4aed464
fixed #434
seankross Jun 22, 2016
0048efd
updated README
seankross Jun 22, 2016
510de5b
updated cran url
seankross Jun 23, 2016
d85769b
Merge pull request #497 from swirldev/dev
seankross Jun 23, 2016
58e4666
added german_formal
seankross Dec 13, 2016
da7ccea
added portuguese
seankross Feb 28, 2017
f9cb2ac
first draft 2.4.3
seankross Feb 28, 2017
a336461
added devel to travis
seankross Mar 1, 2017
a087e02
updated cran comments
seankross Mar 1, 2017
a0fb74b
Merge pull request #599 from swirldev/dev
seankross Mar 3, 2017
87d97d1
fixed encoding test
seankross May 3, 2019
10404a4
updating cran comments before release
seankross May 3, 2019
466dddc
Merge pull request #752 from swirldev/debian-clang-encoding-error
seankross May 15, 2019
53105d3
FIX: partial argument name
HenrikBengtsson Jan 14, 2020
9128de2
Merge pull request #779 from HenrikBengtsson/fix/partial_names
seankross Jan 14, 2020
6900b27
updated version and fixed a test
seankross Jan 16, 2020
25938d2
Merge pull request #781 from swirldev/dev
seankross Jan 16, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
^\.Rproj\.user$
^.*.html$
user_data/
^NEWS.md$
^\.travis\.yml$
^cran-comments\.md$
^revdep$
26 changes: 10 additions & 16 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,21 +1,15 @@
# Sample .travis.yml for R projects from https://github.com/craigcitro/r-travis
language: r

language: c
matrix:
include:
- r: release
- r: oldrel
- r: devel

before_install:
- curl -OL http://raw.github.com/craigcitro/r-travis/master/scripts/travis-tool.sh
- chmod 755 ./travis-tool.sh
- ./travis-tool.sh bootstrap

install:
- ./travis-tool.sh install_deps

script: ./travis-tool.sh run_tests

on_failure:
- ./travis-tool.sh dump_logs
cache: packages
sudo: false

notifications:
email:
on_success: change
on_failure: change
on_success: always
on_failure: always
30 changes: 18 additions & 12 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,26 +1,32 @@
Package: swirl
Title: Learn R, in R.
Description: swirl turns the R console into an interactive learning
Title: Learn R, in R
Description: Use the R console as an interactive learning
environment. Users receive immediate feedback as they are guided through
self-paced lessons in data science and R programming.
URL: http://swirlstats.com
Version: 2.2.15
License: GPL-3
Version: 2.4.5
License: MIT + file LICENSE
Authors@R: c(
person("Nick", "Carchedi", email = "nick.carchedi@gmail.com",
role = c("aut", "cre")),
person("Sean", "Kross", email = "sean@seankross.com", role = c("aut", "cre")),
person("Nick", "Carchedi", role = "aut"),
person("Bill", "Bauer", role = "aut"),
person("Gina", "Grdina", role = "aut"),
person("Sean", "Kross", role = "aut")
person("Filip", "Schouwenaars", role = "ctb"),
person("Wush", "Wu", role = "ctb")
)
Depends:
R (>= 3.0.2)
R (>= 3.1.0)
Imports:
stringr,
testthat,
httr,
testthat (>= 1.0.2),
httr (>= 1.1.0),
yaml,
RCurl,
digest,
tools
Roxygen: list(wrap = FALSE)
tools,
methods
Suggests:
stringi
Encoding: UTF-8
LazyData: true
RoxygenNote: 7.0.2
2 changes: 2 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
YEAR: 2017
COPYRIGHT HOLDER: Team swirl
21 changes: 13 additions & 8 deletions NAMESPACE
Original file line number Diff line number Diff line change
@@ -1,22 +1,30 @@
# Generated by roxygen2 (4.0.1): do not edit by hand
# Generated by roxygen2: do not edit by hand

export(bye)
export(delete_progress)
export(email_admin)
export(info)
export(install_course)
export(install_course_directory)
export(install_course_dropbox)
export(install_course_github)
export(install_course_google_drive)
export(install_course_url)
export(install_course_zip)
export(install_from_swirl)
export(is_robust_match)
export(main)
export(nxt)
export(play)
export(reset)
export(restart)
export(rmatch_calls)
export(select_language)
export(skip)
export(submit)
export(swirl)
export(swirl_options)
export(uninstall_all_courses)
export(uninstall_course)
export(zip_course)
importFrom(RCurl,base64)
Expand All @@ -25,22 +33,19 @@ importFrom(RCurl,postForm)
importFrom(digest,digest)
importFrom(httr,GET)
importFrom(httr,content)
importFrom(httr,progress)
importFrom(methods,is)
importFrom(stringr,fixed)
importFrom(stringr,perl)
importFrom(stringr,str_c)
importFrom(stringr,str_detect)
importFrom(stringr,str_extract)
importFrom(stringr,str_length)
importFrom(stringr,str_locate)
importFrom(stringr,str_match)
importFrom(stringr,str_split)
importFrom(stringr,str_split_fixed)
importFrom(stringr,str_trim)
importFrom(testthat,equals)
importFrom(testthat,expectation)
importFrom(testthat,is_a)
importFrom(testthat,is_equivalent_to)
importFrom(testthat,is_identical_to)
importFrom(testthat,matches)
importFrom(testthat,compare)
importFrom(tools,file_ext)
importFrom(tools,file_path_sans_ext)
importFrom(yaml,yaml.load)
Expand Down
88 changes: 88 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,91 @@
# swirl 2.4.5

* Thank you @HenrikBengtsson for fixing a warning when
`warnPartialMatchArgs=TRUE`. (#779)

# swirl 2.4.4

* Fixed encoding test which was failing on CRAN (debian-clang-devel).

# swirl 2.4.3

* Added "swirl_is_fun" option to `swirl_options()`.

* Added Portuguese menu translations.

# swirl 2.4.2

* Script questions behave more appropriately in RStudio. (#434, thank you @jimhester)

# swirl 2.4.1

* Added new answer test: `calculates_same_value()`.

* Now compatible with versions of testthat later than 0.11.0.

# swirl 2.4.0

* Added support for multiple languages, including Spanish, French, German,
Turkish, Simplified Chinese, and Korean. The default language can be changed
using the function `select_language()`.

* Added `install_course()` in order to install swirl courses that are
distributed in the .swc format.

* The directories where swirl courses and where user data is stored can now be
explicitly specified. These options can be set using the function
`swirl_options()`.

* It's now possible to log and collect a student's progression
through a swirl course. Enable logging with `swirl_options()`.

* Improved support for displaying non-ASCII character sets
through UTF-8 encoding.

* Now compatible with `swirlify::demo_lesson()`.

# swirl 2.3.1

* Add progress bar to track download progress of a course.

# swirl 2.3.0

* Add basic developer API to swirl, courtesy of @filipsch and @seankross.

* Change license to MIT, which is slightly less restrictive than GPL-3 and will make it easy for developers to tap into the new API.

# swirl 2.2.21

* Add `mirror` argument to `install_from_swirl()` to accommodate installing courses from the Bitbucket mirror of our swirl-courses GitHub repository. (Prompted by India's blocking of GitHub.)

* Check for existence of variable in swirl.R to address issue with using `rm()` command.

# swirl 2.2.20

* Fix troublesome bug in `omnitest` due to typo (thanks to @reginaastri).

# swirl 2.2.19

* Add `uninstall_all_courses` function.

# swirl 2.2.18

* Fix small bug in `omnitest` due to missing exclamation point (thanks to @wilcrofter).

* Add `delete_progress` function (thanks to @seankross).

# swirl 2.2.17

* Use of `partner.coursera.org` websites for Coursera submission is enabled.

* `Omnitest` uses `rmatch_calls` (recursive `match.call`) to deal with legitimate variations of function and S3 method calls.

# swirl 2.2.16

* Fix bug in `install_from_swirl()` that was causing `install_from_swirl("R Programming")` to install both `R Programming` and `R Programming Alt`.

* Fix troublesome links to the swirl_courses repo.

# swirl 2.2.15

* Fix annoying typo in one of the "praise" messages.
Expand Down
52 changes: 52 additions & 0 deletions R/actions.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
do_nxt <- function(e)UseMethod("do_nxt")
do_reset <- function(e)UseMethod("do_rst")
do_submit <- function(e)UseMethod("do_submit")
do_play <- function(e)UseMethod("do_play")
do_main <- function(e)UseMethod("do_main")
do_restart <- function(e)UseMethod("do_restart")

do_nxt.default <- function(e) {
## Using the stored list of "official" swirl variables and values,
# assign variables of the same names in the global environment
# their "official" values, in case the user has changed them
# while playing.
if(length(e$snapshot)>0)xfer(as.environment(e$snapshot), globalenv())
swirl_out(s()%N%"Resuming lesson...")
e$playing <- FALSE
e$iptr <- 1
}

do_reset.default <- function(e) {
e$playing <- FALSE
e$reset <- TRUE
e$iptr <- 2
swirl_out(s()%N%"I just reset the script to its original state. If it doesn't refresh immediately, you may need to click on it.",
skip_after = TRUE)
}

do_submit.default <- function(e) {
e$playing <- FALSE
# Get contents from user's submitted script
e$script_contents <- readLines(e$script_temp_path, warn = FALSE)
# Save expr to e
e$expr <- try(parse(text = e$script_contents), silent = TRUE)
swirl_out(s()%N%"Sourcing your script...", skip_after = TRUE)
try(source(e$script_temp_path, encoding = "UTF-8"))
}

do_play.default <- function(e) {
swirl_out(s()%N%"Entering play mode. Experiment as you please, then type nxt() when you are ready to resume the lesson.", skip_after=TRUE)
e$playing <- TRUE
}

do_main.default <- function(e) {
swirl_out(s()%N%"Returning to the main menu...")
# Remove the current lesson. Progress has been saved already.
if(exists("les", e, inherits=FALSE)){
rm("les", envir=e, inherits=FALSE)
}
}

do_restart.default <- function(e) {
swirl_out(s()%N%"This feature is not implemented yet for Swirl.")
}
29 changes: 12 additions & 17 deletions R/answerTests.R
Original file line number Diff line number Diff line change
Expand Up @@ -153,10 +153,10 @@ runTest.newcmd <- function(keyphrase,e){
correct.expr <- parse(text=rightside(keyphrase))[[1]]
correct.ans <- eval(correct.expr)
ansResults <- expectThat(e$val,
equals(correct.ans,label=correct.ans),
equals_legacy(correct.ans,label=correct.ans),
label=e$val)
callResults <- expectThat(as.expression(e$expr)[[1]],
is_identical_to(correct.expr,label=deparse(correct.expr)),
is_identical_to_legacy(correct.expr,label=deparse(correct.expr)),
label=deparse(e$expr))

# identical(as.expression(e$expr)[[1]], as.expression(correct.expr)[[1]])
Expand Down Expand Up @@ -221,7 +221,7 @@ runTest.is_a <- function(keyphrase, e) {
val <- e$val
}
label <- val
results <- expectThat(val, is_a(class), label=label)
results <- expectThat(val, is_a_legacy(class), label=label)
if(is(e,"dev") && !results$passed)swirl_out(results$message)
return(results$passed)
}
Expand All @@ -245,7 +245,7 @@ runTest.matches <- function(keyphrase, e) {
correctVal <- tolower(str_trim(rightside(keyphrase)))
userVal <- str_trim(as.character(e$val))
results <- expectThat(tolower(userVal),
matches(correctVal),
matches_legacy(correctVal),
label=userVal)
if(is(e,"dev") && !results$passed)swirl_out(results$message)
return(results$passed)
Expand All @@ -264,12 +264,12 @@ runTest.creates_var <- function(keyphrase, e){
}
correctName <- rightside(keyphrase)
if(is.na(correctName)){
results <- expectThat(length(delta), equals(1),
results <- expectThat(length(delta), equals_legacy(1),
label=paste(deparse(e$expr),
"does not create a variable."))
} else {
results <- expectThat(names(delta),
is_equivalent_to(correctName, label=correctName),
is_equivalent_to_legacy(correctName, label=correctName),
label=paste(deparse(e$expr),
"does not create a variable named",
correctName))
Expand All @@ -295,7 +295,7 @@ runTest.equals <- function(keyphrase, e){
correctAns <- safeEval(parse(text=correctExpr))
if(length(correctAns) != 1)return(FALSE)
results <- expectThat(e$var,
equals(correctAns[[1]],
equals_legacy(correctAns[[1]],
label=correctExprLabel),
label=deparse(e$expr))
if(is(e, "dev") && !results$passed)swirl_out(results$message)
Expand All @@ -310,7 +310,7 @@ runTest.equivalent <- function(keyphrase,e) {
correctExpr <- as.list(parse(text=rightside(keyphrase)))
userExpr <- as.list(as.expression(e$expr))
results <- expectThat(userExpr,
is_equivalent_to(correctExpr,deparse(correctExpr)),
is_equivalent_to_legacy(correctExpr,deparse(correctExpr)),
label=deparse(userExpr))

if(is(e,"dev") && !results$passed)swirl_out(results$message)
Expand Down Expand Up @@ -345,7 +345,7 @@ runTest.expr_identical <- function(keyphrase, e){
expr <- e$expr
if(is.expression(expr))expr <- expr[[1]]
results <- expectThat(expr,
is_identical_to(correct, label=rightside(keyphrase)),
is_identical_to_legacy(correct, label=rightside(keyphrase)),
label=deparse(expr))
if( is(e, "dev") && !results$passed)swirl_out(results$message)
return(results$passed)
Expand All @@ -359,7 +359,7 @@ runTest.val_length <- function(keyphrase, e){
stop(message=paste("BUG: right side of", keyphrase,
"is not an integer."))
}
results <- expectThat(length(e$val), equals(n, label=n),
results <- expectThat(length(e$val), equals_legacy(n, label=n),
label=paste0("length(c(", toString(e$val), "))"))
if( is(e, "dev") && !results$passed)swirl_out(results$message)
return(results$passed)
Expand Down Expand Up @@ -435,7 +435,7 @@ uses_func <- function(expected, label = NULL, ...){
function(expr){
uses <- (is.call(expr) || is.expression(expr)) &&
expected %in% flatten(expr)
expectation(identical(uses, TRUE),
expectation_legacy(identical(uses, TRUE),
str_c("does not use ", label))
}
}
Expand All @@ -446,12 +446,7 @@ in_range <- function(range, label=NULL){
isOK <- is.numeric(number) &&
isTRUE(number >= range[1]) &&
isTRUE(number <= range[2])
expectation(identical(isOK, TRUE),
expectation_legacy(identical(isOK, TRUE),
str_c("is not between ", range[1], " and ", range[2]))
}
}





Loading