I would love to take advantage of usethis::use_course(), but I keep getting the following error:
> usethis::use_course(shortURL, destdir = getwd())
Downloaded: 1.26 MB (100%)
β Downloaded ZIP file to 'C:/Users/ajf/OneDrive/Teaching/FSAN830 - Spring2019/testUseThisDownload/2TnwCYe'
Error in if (length(unique_top) > 1 || !is_directory) { :
missing value where TRUE/FALSE needed
Here is reproducible code:
# longer URL:
# https://github.com/flyaflya/lotr-tidy/raw/master/rFilesForDataVizClass.zip
shortURL = "https://bit.ly/2TnwCYe"
usethis::use_course(shortURL, destdir = getwd())
Any help/guidance is greatly appreciated. I would love to use this feature all the time.
The use_course
function needs you to link to the .zip for the repository, and not a .zip inside of your repo.
This will work:
shortURL = "https://bit.ly/2EvWpEb"
usethis::use_course(shortURL, destdir = getwd())
The shortURL
points to https://github.com/flyaflya/lotr-tidy/archive/master.zip
Hope that helps!
3 Likes
Here are more details on how to use from the docs:
GitHub:
Click on the repo's "Clone or download" button, to reveal a "Download ZIP" button. Capture this URL, which will have this form:
https://github.com/r-lib/usethis/archive/master.zip
This download link (or a shortlink that points to it) is suitable as input for download_zip()
. After one or more redirections, this link will eventually lead to a download URL. Here's an alternative link that also leads to ZIP download, albeit with a different filenaming scheme:
https://api.github.com/repos/r-lib/usethis/zipball/master
1 Like
Thanks everyone, this is a great community and the responsiveness is outstanding!
As soon as I link to the whole repository, it works. I got thrown by the documentation where it says:
Function developed with DropBox and GitHub in mind, but should work for ZIP files generally.
cderv
March 4, 2019, 6:56pm
5
If your question's been answered (even by you!), would you mind choosing a solution? It helps other people see which questions still need help, or find solutions if they have similar problems. Hereβs how to do it:
If your question has been answered, don't forget to mark the solution!
How do I mark a solution?
Find the reply you want to mark as the solution and look for the row of small gray icons at the bottom of that reply. Click the one that looks like a box with a checkmark in it:
[image]
Hovering over the mark solution button shows the label, "Select if this reply solves the problem". If you don't see the mark solution button, try clicking the three dots button ( β’β’β’ ) to expand the full set of options.
When a solution is chosen, the icon turns green and the hover label changes to: "Unselect if this reply no longer solves the problem". Success!
[solution_reply_author]
β¦
1 Like
system
Closed
March 11, 2019, 6:56pm
6
This topic was automatically closed 7 days after the last reply. New replies are no longer allowed. If you have a query related to it or one of the replies, start a new topic and refer back with a link.