所以,我尝试将一个R文档编织成一个超文本标记语言文件,但是,当编织时产生这个错误"#Error in table(StudentSurvey$Gender,StudentSurvey$Smoke):object 'StudentSurvey‘not found“
作为参考,这是我的R代码。
read.csv("StudentSurvey.csv")
barplot(table(StudentSurvey$Gender, StudentSurvey$Smoke), legend=TRUE)
boxplot(StudentSurvey$Pulse ~ StudentSurvey$Smoke , xlab = "Smoke" , ylab = "Pulse")我不确定出了什么问题,我试图通过更改我的Rworking目录来解决问题,并确保"StudentSurvey.csv“在那里,但是这个问题似乎正在发生。如果不是很明显,我对R非常陌生,因为我是第一次在UNI中使用它,所以如果这是一个简单的修复,我很抱歉。
发布于 2021-03-26 03:46:44
您只需要将read.csv()的输出赋值给一个对象。
StudentSurvey <- read.csv("StudentSurvey.csv")https://stackoverflow.com/questions/66794897
复制相似问题