來自R降價收到此錯誤時,我的.RMD莫名其妙的錯誤嘗試嘗試導出時導出我的筆記本電腦 - [R
"Error in filter(Gastropods, Species == "Cellana") : object 'Species' not found Calls: <Anonymous> ... withCallingHandlers -> withVisible -> eval -> eval -> filter"
然而,我所有的地塊都成功地走出來。我可以在數據中清楚地看到,物種欄在那裏,而Cellana是一個物種。沒有拼寫錯誤或任何東西。代碼
我的第20行左右低於
###
---
title: " Lab Report 2 - z5016113"
output: html_notebook
i---
#1. Gastropod abundance vs. height on the shore
```{r}
Gastropods <- read.csv(file = "MaroubraZones.csv", header = TRUE)
library(ggplot2, dplyr)
```
```{r}
Gastropods$Zone <- factor(Gastropods$Zone, levels = c("Low", "Mid", "High"))
```
```{r}
Cellana <- filter(Gastropods, Species == "Cellana") ------> This line is causing the error
```
```{r}
ggplot(Cellana, aes(Zone, Abundance)) + geom_boxplot()
```
###
檢查'colnames(腹足動物)',也許將其添加到您的問題。 – Marius
等待,您不要在R代碼中加載'dplyr'或'tidyverse'。在編織時,RMarkdown總會啓動一個新的會話,因此您需要確保以代碼塊加載任何相關的庫。 – Marius