Pamela Osborne
Pamela Osborne

Reputation: 1

My code will run as a chunk but gives me an error when I try to knit

Hi I'm new to R and I'm using RStudio Cloud for a university stats course.

The code I'm having trouble with will run as a chunk but when I try to knit the project it comes up with an error saying that the object 'filename' not found.

The 'filename' is listed in the global environment but it is a tbl_df, which I'm thinking is not the right kind of object for knitting.

screencapture

Upvotes: 0

Views: 366

Answers (1)

Ewen
Ewen

Reputation: 43

It is difficult to answer without having all the code. And code is almost always better than a screenshot.

My guess is that you loaded the dataset X2019THBrier manually in RStudio. Thus you can access it in chunks, in the current R session, but not in the knitted R session.

You need to write commands to load the data. As you are loading an XLSX file, you might want to install the openxlsx package, and use the openxlsx::read.xlsx() command.

Upvotes: 1

Related Questions