0

Downloading a course onto R (Windows 10). Keep getting an error. Tried pulling it from downloads and desktop. Any ideas?:

> install_course_zip(C:\Users\pencity\Downloads\14_310x_Intro_to_R.zip,multi=FALSE)
Error: unexpected input in "install_course_zip(C:\"
> install_course_zip("C:\Users\pencity\Downloads\14_310x_Intro_to_R.zip",multi=FALSE)
Error: '\U' used without hex digits in character string starting ""C:\U"
> install_course_zip(C:Users\pencity\Desktop\14_310x_Intro_to_R.zip",multi=FALSE)
Error: unexpected input in "install_course_zip(C:Users\"
> install_course_zip(Users\pencity\Desktop\14_310x_Intro_to_R.zip",multi=FALSE)
r2evans
  • 141,215
  • 6
  • 77
  • 149
  • 1
    \ is the `escape` character, to use them in a string make sure you use a double backslash \\ to escape the basckslash – Snel23 Sep 04 '19 at 03:50
  • 3
    Amy, even on windows R will accept the forward-slash as a path delimiter. While there is no *functional* difference between the two, in R you must (as @Snel23 demonstrated) escape it for each directory separator (`C:\\Users\\pencity\\...`), whereas the forward-slash does not (`C:/Users/pencity/...`). (And *always* put single or double quotes around your filenames here, they must be proper strings in this case.) – r2evans Sep 04 '19 at 03:53
  • Possible duplicate of [File path issues in R using Windows ("Hex digits in character string" error)](https://stackoverflow.com/questions/8425409/file-path-issues-in-r-using-windows-hex-digits-in-character-string-error) – NelsonGon Sep 13 '19 at 12:45

1 Answers1

0

RStudio with two similar commands. The first one uses the “ ” and got an error, while the second one uses the " " and RStudio accepted it.

EDIT: As requested, I would like to add more context to my answer.

Based on the question, 14.310x is the Data Analysis for Social Scientists (Sep. 2019) course provided via edX platform.

The command: install_course_zip("14_310x_Intro_to_R.zip",multi=FALSE)

is in Module 1, under Introduction to R section.

ORIGINAL:

I found that the quotation that was copied from the course page and the one we type directly in the console is different.

The quotation from the course page looks like this (“ ”), while the one we type directly into the console looks like this (" ").

To solve the problem, type quotation manually, and then copy the full path inside the quotation. This way works for me.

GiniPig
  • 373
  • 1
  • 3
  • 7
  • I see no indication in the question that the "fancy quotes" are being used. What suggests that this is the case? – r2evans Sep 12 '19 at 19:54
  • 1
    Is it fair to assume that you and AmySluiter are in the same class? There appears to be knowledge of "course material" that cannot be solidly inferred from the OP. If this is resolved as you suggested, I **request** that there be sufficient context added to the question and/or answer so that somebody outside of your class will be able to apply this to their situation. As it stands, there is a bit of a non sequitor here. – r2evans Sep 13 '19 at 02:14
  • What the question simply ask is that "something was wrong with theses commands but I don't know where it is". This is why the quotation was not mentioned. In the course outline, they guided the students step-by-step on how to install the course tutorial. One of them being: Type install_course_zip(“14_310x_Intro_to_R.zip”,multi=FALSE) Now if we simply copy this command directly from the course into Rstudio, it will not work. What I have found is that the quotation that Rstudio accept and the one from the course are different. – GiniPig Sep 13 '19 at 02:16
  • @r2evans I agree with you that this is a pretty specific question. – GiniPig Sep 13 '19 at 02:18