我明确遵循了指令,无法执行任何操作。我对编程几乎一无所知,因此任何反馈或说明将非常有帮助。下载文件并加载漩涡库后,您将需要运行RStudio(或R),然后 在控制台中输入以下内容:
install_course_zip(“YOUR_PATH/14_740x_Intro_to_R.zip”,multi=FALSE)
YOUR_PATH
是保存在步骤1中下载的zip文件的文件夹路径。
通常看起来像这样:
Mac:/Users/johndoe/Desktop
Windows:C:\Users\johndoe\Desktop
我尝试了以下所有操作,供参考,我的文件位置为C:\Users\smari\Desktop
,而我进行的尝试如下:
s\smari\AppData\Local\Temp\Rtmps5KyXp\downloaded_packages
>
> library ("swirl")
| Hi! Type swirl() when you are ready to begin.
> install_course_zip("YOUR_PATH/14_740x_Intro_to_R.zip",multi=FALSE)
Warning message:
In unzip(path, exdir = swirl_courses_dir()) :
error 1 in extracting from zip file
> Windows: C:\Users\johndoe\Desktop
Error: unexpected input in "Windows: C:\"
> install_course_zip("Windows: C:\Users\johndoe\Desktop/14_740x_Intro_to_R.zip",multi+FALSE)
Error: '\U' used without hex digits in character string starting ""Windows: C:\U"
> install_course_zip(Windows: C:\Desktop\14_740x_Introto_R.zip",multi=FALSE)
Error: unexpected input in "install_course_zip(Windows: C:\"
> install_course_zip("Windows: C:\Desktop\14_740x_Introto_R.zip",multi=FALSE)
Error: '\D' is an unrecognized escape in character string starting ""Windows: C:\D"
> install_course_zip("Windows: C:\Users\Shawna\Desktop\14_740x_Introto_R.zip",multi=FALSE)
Error: '\U' used without hex digits in character string starting ""Windows: C:\U"
> install_course_zip("Desktop\14_740x_Introto_R.zip",multi=FALSE)
Warning message:
In unzip(path, exdir = swirl_courses_dir()) :
error 1 in extracting from zip file
> install_course_zip("C:\Desktop\14_740x_Introto_R.zip",multi=FALSE)
Error: '\D' is an unrecognized escape in character string starting ""C:\D"
> install_course_zip("Desktop\14_740x_Introto_R.zip",multi=FALSE)
Warning message:
In unzip(path, exdir = swirl_courses_dir()) :
error 1 in extracting from zip file
> install_course_zip("Windows: C:Users\smari\Desktop\14_740x_Introto_R.zip",multi=FALSE)
Error: '\s' is an unrecognized escape in character string starting ""Windows: C:Users\s"
> install_course_zip("Windows: C:\Users\smari\Desktop\14_740x_Intro_to_R.zip",multi=FALSE)
Error: '\U' used without hex digits in character string starting ""Windows: C:\U"
> install_course_zip("Windows: C:\Desktop\14_740x_Introto_R.zip",multi=FALSE)
Error: '\D' is an unrecognized escape in character string starting ""Windows: C:\D"
> install_course_zip("C: Users\smari\Desktop\14_740x_Intro_to_R.zip”,multi=FALSE)
Error: '\s' is an unrecognized escape in character string starting ""C: Users\s"
> C:\Users\smari\Desktop
Error: unexpected input in "C:\"
>
> install_course_zip("Windows: C:\Users\smari\Desktop_PATH/14_740x_Intro_to_R.zip",multi=FALSE)
Error: '\U' used without hex digits in character string starting ""Windows: C:\U"
>
> install_course_zip("Windows: C:\\USERS\\SMARI\\Desktop_PATH/14_740x_Intro_to_R.zip",multi=FALSE)
Warning message:
In unzip(path, exdir = swirl_courses_dir()) :
error 1 in extracting from zip file
>
> install_course_zip("WindowsExplorer: C:\\USERS\\SMARI\\Desktop_PATH/14_740x_Intro_to_R.zip",multi=FALSE)
Warning message:
In unzip(path, exdir = swirl_courses_dir()) :
error 1 in extracting from zip file
> install_course_zip("WindowsExplorer: C:\\USERS\SMARI\Desktop_PATH/14_740x_Intro_to_R.zip",multi=FALSE)
Error: '\S' is an unrecognized escape in character string starting ""WindowsExplorer: C:\\USERS\S"
> install_course_zip("WindowsExplorer: C:\\USERS\\smari\\Desktop/14_740x_Intro_to_R.zip",multi=FALSE)
Warning message:
In unzip(path, exdir = swirl_courses_dir()) :
error 1 in extracting from zip file
> install_course_zip("WindowsExplorer: C:\USERS\smari\Desktop+_/14_740x_Intro_to_R.zip",multi=FALSE)
Error: '\U' used without hex digits in character string starting ""WindowsExplorer: C:\U"
> install_course_zip("C:\USERS\smari\Desktop/14_740x_Intro_to_R.zip",multi=FALSE)
Error: '\U' used without hex digits in character string starting ""C:\U"
> install_course_zip("C:
+
+ l
+ jl
+
+ install_course_zip("C:\Users\smari\Desktop/14_740x_Intro_to_R.zip",multi=FALSE)
Error: unexpected symbol in:
"
install_course_zip("C"
> install_course_zip("C:\Users\smari\Desktop/14_740x_Intro_to_R.zip",multi=FALSE)
Error: '\U' used without hex digits in character string starting ""C:\U"
> install_course_zip("C:\\Users\smari\Desktop/14_740x_Intro_to_R.zip",multi=FALSE)
Error: '\s' is an unrecognized escape in character string starting ""C:\\Users\s"
> install_course_zip("C:\Users\smari\Desktop\14_740x_Intro_to_R.zip",multi=FALSE)
Error: '\U' used without hex digits in character string starting ""C:\U"
> install_course_zip("C:\Users\smari\Desktop\14_740x_Intro_to_R.zip",multi=FALSE)
Error: '\U' used without hex digits in character string starting ""C:\U"
> install_course_zip("C:\\Users\\smari\\Desktop/14_740x_Intro_to_R.zip",multi=FALSE)
> install_course_zip("C:\\Users\smari\Desktop/14_740x_Intro_to_R.zip",multi=FALSE)
Error: '\s' is an unrecognized escape in character string starting ""C:\\Users\s"
> install_course_zip("Windows: C:\Users\smari\Desktop/14_740x_Intro_to_R.zip",multi=FALSE)
Error: '\U' used without hex digits in character string starting ""Windows: C:\U"
> install_course_zip(“C:Users/smari/Desktop/PATH/14_740x_Intro_to_R.zip”,multi=FALSE)
Error: unexpected input in "install_course_zip(“"
> install_course_zip("Users/smari/Desktop/14_740x_Intro_to_R.zip",multi=FALSE)
Warning message:
In unzip(path, exdir = swirl_courses_dir()) :
error 1 in extracting from zip file
> ("C: /Users/smari/Desktop/14_740x_Intro_to_R.zip",multi=FALSE)
Error: unexpected ',' in "("C: /Users/smari/Desktop/14_740x_Intro_to_R.zip","
我应该能够学习一门有关使用R的课程,然后再输入一些数据进行分析。我需要它做作业。抱歉,没有更多信息,我很困惑。谢谢!
答案 0 :(得分:0)
反斜杠(\
)是R
中的转义字符。要解决此问题,您可以使用\\
或使用正斜杠语法对字符本身进行转义(R不在乎您的Windows路径是否用正斜杠声明)。
这意味着
install_course_zip("C:\Users\smari\Desktop_PATH\14_740x_Intro_to_R.zip",multi=FALSE)
应替换为:
install_course_zip("C:/Users/smari/Desktop/14_740x_Intro_to_R.zip",multi=FALSE)
OR
install_course_zip("C:\\Users\\smari\\Desktop\\14_740x_Intro_to_R.zip",multi=FALSE)