'I cannot knit to a pdf in R due to an error but I don't have the error when coding [closed]

I am having an error in R when knitting to a pdf, but the code it says has an error is running fine.

Here is the code:

FishData <- data.frame(nymphs, creek, treat)

FishData$creek <- as.factor(FishData$creek)
FishData$treat <- as.factor(FishData$treat)

The error is for the lines with as.factor() saying:

Error in is.factor(FishData$creek) : object 'FishData' not found

I don't know how to fix this.

r


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source