楼主: 08liurenxing
14775 2

[问答] R语言提示错误,attempt to use zero-length variable name [推广有奖]

  • 0关注
  • 2粉丝

已卖:1254份资源

讲师

16%

还不是VIP/贵宾

-

威望
0
论坛币
4932 个
通用积分
6.5679
学术水平
8 点
热心指数
11 点
信用等级
5 点
经验
7740 点
帖子
424
精华
0
在线时间
153 小时
注册时间
2009-11-9
最后登录
2023-12-9

楼主
08liurenxing 发表于 2015-10-24 22:46:10 |AI写论文

+2 论坛币
k人 参与回答

经管之家送您一份

应届毕业生专属福利!

求职就业群
赵安豆老师微信:zhaoandou666

经管之家联合CDA

送您一个全额奖学金名额~ !

感谢您参与论坛问题回答

经管之家送您两个论坛币!

+2 论坛币
attempt to use zero-length variable name


R version 3.2.2 (2015-08-14) -- "Fire Safety"
Copyright (C) 2015 The R Foundation for Statistical Computing
Platform: x86_64-w64-mingw32/x64 (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

[Workspace loaded from ~/.RData]

> ```{r}
Error: attempt to use zero-length variable name
> library(abind)
> library(arm)
载入需要的程辑包:MASS
载入需要的程辑包:Matrix
载入需要的程辑包:lme4

arm (Version 1.8-6, built: 2015-7-7)

Working directory is C:/Users/17486/Documents

> library(caret)
载入需要的程辑包:lattice
载入需要的程辑包:ggplot2
>
> ```
Error: attempt to use zero-length variable name
> ## Loading required package: lattice
> ## Loading required package: ggplot2
>
> ```{r}
Error: attempt to use zero-length variable name
> library(kernlab)
> library(klaR)
> library(rattle)
载入需要的程辑包:RGtk2
Rattle: A free graphical interface for data mining with R.
XXXX 3.5.0 Copyright (c) 2006-2015 Togaware Pty Ltd.
键入'rattle()'去轻摇、晃动、翻滚你的数据。
> ```
Error: attempt to use zero-length variable name
> ## Rattle: A free graphical interface for data mining with R.
> ## Version 3.3.0 Copyright (c) 2006-2014 Togaware Pty Ltd.
> ## Type 'rattle()' to shake, rattle, and roll your data.
>
> ```{r}
Error: attempt to use zero-length variable name
> library(randomForest)
randomForest 4.6-12
Type rfNews() to see new features/changes/bug fixes.
> ```
Error: attempt to use zero-length variable name
> ## randomForest 4.6-10
> ## Type rfNews() to see new features/changes/bug fixes.
> ```{r}
Error: attempt to use zero-length variable name
> library(rpart)
> ```
Error: attempt to use zero-length variable name
>
> Seed for pseudo-random generator
Error: unexpected 'for' in "Seed for"
> ```{r}
Error: attempt to use zero-length variable name
> set.seed(12345)
> ```
Error: attempt to use zero-length variable name
> ```{r}
Error: attempt to use zero-length variable name
> library(abind)
> library(arm)
> library(caret)
>
> ```
Error: attempt to use zero-length variable name
> ## Loading required package: lattice
> ## Loading required package: ggplot2
>
> ```{r}
Error: attempt to use zero-length variable name
> library(kernlab)
> library(klaR)
> library(rattle)
> ```
Error: attempt to use zero-length variable name
> ## Rattle: A free graphical interface for data mining with R.
> ## Version 3.3.0 Copyright (c) 2006-2014 Togaware Pty Ltd.
> ## Type 'rattle()' to shake, rattle, and roll your data.
>
> ```{r}
Error: attempt to use zero-length variable name
> library(randomForest)
> ```
Error: attempt to use zero-length variable name
> ## randomForest 4.6-10
> ## Type rfNews() to see new features/changes/bug fixes.
> ```{r}
Error: attempt to use zero-length variable name
> library(rpart)
> ```
Error: attempt to use zero-length variable name
>
> Seed for pseudo-random generator
Error: unexpected 'for' in "Seed for"
> ```{r}
Error: attempt to use zero-length variable name
> set.seed(12345)
> Seed for pseudo-random generator
Error: unexpected 'for' in "Seed for"
> ```{r}
Error: attempt to use zero-length variable name
> set.seed(12345)
> ```
Error: attempt to use zero-length variable name
> ```{r}
Error: attempt to use zero-length variable name
> urlTrain <- "http://d396qusza40orc.cloudfront.net/predmachlearn/pml-training.csv"
> urlTest <- "http://d396qusza40orc.cloudfront.net/predmachlearn/pml-testing.csv"
> ```
Error: attempt to use zero-length variable name


这个不知道啥问题,请教高手,感谢!

二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

关键词:zero-length Variable Attempt length leng Copyright software welcome version licence

沙发
08liurenxing 发表于 2015-10-25 09:09:14
木有人回复吗,请教了!

藤椅
rendachy 发表于 2015-10-26 17:58:36
不要直接选中代码然后ctrl+R,因为这些代码是钩子(chunk)函数。
你可以在RStudio编辑窗口的右上角找到那个chunk的按钮,打开之后就能找到你要的了,或者直接ctrl+Alt+R,以上。

您需要登录后才可以回帖 登录 | 我要注册

本版微信群
加好友,备注cda
拉您进交流群
GMT+8, 2026-1-2 04:18